Make a nested tree of React components out of a flat array
npm install react-array-to-treenpm i react-array-to-tree or yarn add react-array-to-tree
If you have a React application with multiple contexts you might end up with
a deep nested tree of context providers, something like this:
``tsx`
const AppWithProviders = () => (
)
To make the structure more flat you can use this library:
`tsx
import reactArrayToTree from 'react-array-to-tree';
const Provider = reactArrayToTree([
]);
const AppWithProviders = () => (
);
``