You can pass JSON.stringify(outcomes)
as the dependency list:
Read more here
useEffect(() => {
console.log(outcomes)
}, [JSON.stringify(outcomes)])
More Related Contents:
- Infinite loop in useEffect
- React-hooks. Can’t perform a React state update on an unmounted component
- React useState cause double rendering
- React Hook : Send data from child to parent component
- React useReducer async data fetch
- Line 0: Parsing error: Cannot read property ‘map’ of undefined
- In general is it better to use one or many useEffect hooks in a single component? [closed]
- React hooks useEffect only on update?
- Stop useEffect from running on mount
- useNavigate() may be used only in the context of a component
- Testing React components that fetches data using Hooks
- Why React useState with functional update form is needed?
- React.useState does not reload state from props
- How do react hooks determine the component that they are for?
- React Hooks: how to wait for the data to be fetched before rendering
- useReducer Action dispatched twice
- Does a render happen before function in React Hooks useEffect is called?
- React Hooks – Modified state not reflecting immediately
- React Hooks: Why is .current null for useRef Hook?
- Attempted import error: ‘useHistory’ is not exported from ‘react-router-dom’
- is it possible to React.useState(() => {}) in React?
- React Hooks – How do I implement shouldComponentUpdate?
- Field Array in React using formik
- How to test a react component that is dependent on useContext hook?
- What is the expected return of `useEffect` used for?
- ReactJS – prevState in the new useState React hook?
- React – Is useState ‘s setter function able to change?
- Which react hook to use with firestore onsnapshot?
- How do I window removeEventListener using React useEffect
- React Hook useEffect has a missing dependency: ‘list’