-
-
Save SaraVieira/837016e9ddd1e94579aee424023baa37 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
React.useEffect(() => { | |
// Make sure our index stays in bounds with max templateInfos | |
const totalCount = getTotalTemplateCount(); | |
if (focusedTemplateIndex >= totalCount || focusedTemplateIndex < 0) { | |
safeSetFocusedTemplate(i => i); | |
} | |
// We only want this check to happen if templateInfos changes. Only then we | |
// can get our index out of bounds | |
// eslint-disable-next-line | |
}, [templateInfos]); |
This file contains hidden or 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
React.useEffect(() => { | |
if (initializeProperties) { | |
initializeProperties({ | |
onCreateModuleClick, | |
onCreateDirectoryClick, | |
onUploadFileClick, | |
}); | |
} | |
// eslint-disable-next-line react-hooks/exhaustive-deps | |
}, []); |
This file contains hidden or 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
useEffect(() => { | |
if (props.value) { | |
updateValues(props.value); | |
} | |
// eslint-disable-next-line | |
}, []); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment