1

In the following line:

it loads the json data using useMemo

import MOCK_DATA from './MOCK_DATA.json'
const data = useMemo(() => MOCK_DATA, [])

As it's mentioned in ReactTable that It's important that we're using React.useMemo here to ensure that our data isn't recreated on every render.

My question is will the import statement in reactjs be triggered each time the js file is executed (and that makes useMemo necessary)? If yes, is there a source that mentioned that?

william007
  • 17,375
  • 25
  • 118
  • 194

0 Answers0