MCPcopy Index your code
hub / github.com/4ian/GDevelop / useForceUpdate

Function useForceUpdate

newIDE/app/src/Utils/UseForceUpdate.js:5–11  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3
4// https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
5export default function useForceUpdate(): () => void {
6 const [, updateState] = React.useState();
7 // $FlowFixMe[incompatible-type]
8 const forceUpdate = React.useCallback(() => updateState({}), []);
9
10 return forceUpdate;
11}
12
13export function useForceRecompute(): [{}, () => void] {
14 const [recomputeTrigger, updateState] = React.useState({});

Calls

no outgoing calls

Tested by

no test coverage detected