Instantly share code, notes, and snippets.

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