-
-
Save gaearon/62866046e396f4de9b4827eae861ff19 to your computer and use it in GitHub Desktop.
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