Closed saifulshihab closed 3 years ago
Note: I clone this repo
When I add the product dependency in useEffect() it's just re-run the component multiple times. I don't know why it's not working, the same thing works in UserEditScreen. Please check this :) Line: https://github.com/bradtraversy/proshop_mern/blob/4f47ea707d06e60b72f06aea300fb2e0b135e60d/frontend/src/screens/ProductEditScreen.js#L53
It's showing this error: 'This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render. in ProductEditScreen (created by Context.Consumer)'
clone the latest repo and try again. I do not see this issue on the latest repo. let me know if you have any issue.
Solved! had a mistake in Reducer
sounds good.
Note: I clone this repo
When I add the product dependency in useEffect() it's just re-run the component multiple times. I don't know why it's not working, the same thing works in UserEditScreen. Please check this :) Line: https://github.com/bradtraversy/proshop_mern/blob/4f47ea707d06e60b72f06aea300fb2e0b135e60d/frontend/src/screens/ProductEditScreen.js#L53
It's showing this error: 'This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render. in ProductEditScreen (created by Context.Consumer)'