/hooks_pseudocode.js Secret
Created
November 1, 2018 10:08
Star
You must be signed in to star a gist
Hooks implementation pseudocode by @jamiebuilds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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