-2

I am facing an issue while passing props from parent component to child component in React. Since in development mode, with React.StrictMode ON, it renders for two times. It is correctly rendering, for two times, in parent component. On contrary, while passing it as a prop to child component, it renders correctly for first time and shows 'undefined' for second time.

enter image description here

Here, in Parent component, property prop is correctly rendering, as seen in console. (I have deliberately used useMemo() hook to overcome this issue, but in vain).

enter image description here

Here, I am passing memoizedProperty as a prop to child component.

enter image description here

As evident, in the second time rendering, this prop is showing undefined. Any help to this issue will be highly appreciated.

2

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.