Rerender a component using useEffect ?
I love learning about technology and sharing that with others
hello everyone i know no one is reading my blogposts this is just for my own documentation so that I can refer to this when I really need this .
so here we are rerendering the component once there is update in the redux state ## so once the state is updated we are rerendering the component
- Background :
once we are adding the milestones we want that the new contract page should reload the component that is milestones and not the complete page that is so cool that we can rerender the part of the page

const newcontractReducer = useSelector((state) => state.newcontractReducer)
const dispatch = useDispatch()
const [storedMilestones, setMilestoneDrop] = useState(
newcontractReducer.milestones
)
//so now what will happen this component will rerender once we the state is updated and new value is stored in that
useEffect(() => {
setMilestoneDrop(newcontractReducer.milestones)
}, [newcontractReducer])

