I have been following the Container pattern in which I have a container component, say PreferencesContainer, and it is connected to Redux. It fetches some information from an API and it passes this information as props down to Preferences, which builds a list of preferences. Preferences then passes some of that information as props to PreferencePanel, which renders details of a particular preference type . PreferencesPanel has a component that manages adding and removing preferences, let's just call it Updater for simplicity, and it needs some of that data as well.
Because I have a tree that is four levels deep, I decided to explore using Context so that I didn't have to pass props down through all children components. I connected the context provider and made it fetch the data from the API that the container component was originally doing. This works. However, after refactoring, I ended up with a really plain PreferencesContainer that didn't do much. In fact, it probably could go away now.
Questions
Is this an anti-pattern? Am I misusing Context? I searched all day yesterday and I couldn't find an example of a context provider that is connected to Redux, so it worries me a bit.
No responses yet.