How useMemo works with destructuring syntax?

436 views Asked by At

On the project that we are developing, I have the task of optimizing the application, including using optimization. Wrote this piece of code...

const {
  searchSupported,
  searchPaginationQuery,
  searchModalTableColumns,
  textFieldAccessor,
  searchSourceContext,
} = useMemo(() => searchHelp, [searchHelp]);

Tell me, how THIS CODE makes sense? And if anyone understood, tell me how well destructuring works with useMemo (). Thanks in advance!

Expected Result: Variables searchSupported, searchPaginationQuery, searchModalTableColumns, textFieldAccessor, searchSourceContext are memoized.

0

There are 0 answers