Skip to content

Instantly share code, notes, and snippets.

@gaearon
Created November 1, 2018 10:08
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Hooks implementation pseudocode by @jamiebuilds
// Originally written by @jamiebuilds
let hooks = null;
export function useHook() {
hooks.push(hookData);
}
function reactInternalRenderAComponentMethod(component) {
hooks = [];
component();
let hooksForThisComponent = hooks;
hooks = null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment