We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export default function GuardSetting (props:any) { const [, forceUpdate] = useReducer(x => x + 1, 0); return ( <Paper sx={{ width: '100%', pt:'1em', }} > <SettingHeader name={'Launch Guard'}/> <ReactFlowProvider> <GuardGraph {...props} forceUpdate={forceUpdate}/> </ReactFlowProvider> </Paper> ); }
Is there any more elegant way to refresh GuardGraph without using window.location.reload()? Thx.
The text was updated successfully, but these errors were encountered:
Hi, let me help to answer this question. Force update can be done by changing the key of component/element.
const [key, setKey] = useState('first-key'); const forceUpdate = () => { setKey(crypto.randomUUID()); } return ( <GuardGraph key={key} {...props} )
by doing this, the component will be forced to re-render. Read more this documention about key. Hopefully this answer your question!
Sorry, something went wrong.
No branches or pull requests
Is there any more elegant way to refresh GuardGraph without using window.location.reload()?
Thx.
The text was updated successfully, but these errors were encountered: