score:0
the issue was that prior to calling useselector
on losses, i was doing a dispatch to fetchlosses
by using useeffect()
method of react-hook-form . found out that the component was not updated. with the new loss values. i need a re-render to update the component
fix:
useeffect(() => {
reset(knownlosses)
}[reset, knownlosses]
i had to call the reset
method of useform()
to update the form with the newly fetched knownlosses
Source: stackoverflow.com
Related Query
- useFieldArray not reading data passed in to fields
- React: reading data passed as parameter in history.push
- Apollo Client is not reading variables passed in using useQuery hook
- Ways to fix a child component that is not re-rendering (due to change in data being passed in as props, not state)?
- Apollo: data / mutation prop not passed to component
- CreateContext hook is not passed data to child component on button click event
- Data passed as props is not shown in django and reactjs
- React - api data is being successfully passed to component(per inspector) but not being rendered
- React - Ajax data not being passed into Child Component
- Data not getting passed to View of Component using React-Redux (from mapStateToProps) in Container
- data not getting passed on clicking submit in material-ui react login form
- Not able to insert data in few ReactJs Form input fields
- React Redux Data not being passed to props
- Meteor 1.3, React, React Router - data not getting passed through
- Data not passed in props to child componenets
- Parent State not updating when passed data from child component
- Axios POST does not recognize the data being passed in from react
- Nodejs not reading react login form data
- React passed data from child to parent not logging in parent
- TypeError: d[("get" + method)] is not a function in reactjs while reading data from firebase
- data fetched from api is not passed as props to nested component
- Context data does not get passed into nested component: React+Typescript+ContextAPI
- React State data not able to be passed as props
- Prop passing data information, but not reading properties
- Data is not being passed correctly via props React
- Why table is not showing any data that is passed into usetable
- My react node app not reading data from backend after deploying on heroku
- After reading the excel in the react , my excel(json) data is not geting updated in the usestate (setItems)
- Data not being passed from state to props on GET request
- React.js - default prop is not used with `null` is passed
More Query from same tag
- Cannot fetch data after refreshing the page in Next.js
- Retrieve back navigation action from react router
- Spy on a function inside a component method
- React native :Unable to resolve module Indeed, none of these files exist:
- How can I use a state in a url to make a get using axios in reactjs
- Destructuring in proper way
- Type Error: cannot read undefined when mapping through an API
- How to send conditional props from Parent to Child. (send if only array is not empty)
- How to add a class to body only a route
- What does the @ symbol mean in a react import statement
- React styled component not passing props from attribute
- setting state after calling api in react
- Multiple function calls inside curly braces in React JSX
- How can I update the date placeholder option onMouseOver in react
- added item to state but can't render
- Reactjs - Changing an item in randomized array via button
- How to Redirect after POST request in react-router v5 with Hooks
- localStorage data keeps resetting on page reload - React js
- How to create a correct URL according to nested routes?
- how do i change state on this navbar
- TypeError: Cannot read property 'value' of undefined (d is undefined)
- Which param triggered React.useMemo recalculation?
- When I update the state variable of child component ,why it cause infinite loop?
- React inline styling with multiple inputs
- How to style the border of a MUI outlined TextField?
- How to fix Objects are not valid as a React child
- How to handle one-to-many relationships in Flux stores
- React router accessing route properties in route component
- Correct way to fetch through array
- Hooks useState is formik - React