Skip to content

useUpdateEffect

Function
useUpdateEffect(effectany, depsany): void

React effect hook that ignores the first invocation (e.g. on mount). The signature is exactly the same as the useEffect hook.

example:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
const Component = ({ value }) => {
useUpdateEffect(() => {
  console.log('update')
}, [value])

return <div />

@param effect
@param deps
Parameters
ParameterType
effectany
depsany
Returns 
void

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.