I am trying to fetch some data from local JSON to Reac. I have searched and come to two methods: useEffect and componentDidMount. Which one should I use?
CodePudding user response:
If you use functional component (React version >= 16.8) use UseEffect
and If you use class component you should use componentDidMount
.