Recursive lists in React using Context

Photo by Markus Spiske temporausch.com from Pexels

Recently I have been working a lot with recursive trees, and displaying them in React. While working with them I came up with a pattern that I like, and that I want to share with those that run into this pattern. They can overcome this hurdle in a way that can be re-used quite easily.