1

I have a (very) small working portfolio site built using React that highlights various simple web development applications. Currently, this entire React app is technically only just one page, but I'd like to eventually expand this site to reflect my additional work as a graphic designer.

I want visitors to be able to choose whether to view my design work or my coding work. I know that this can be done by essentially creating a second copy of each component, but is there any way to basically use the same existing components in my application and just feed "design" versus "web" data through them based on which work visitors are interested in? Could "design" and "web" data would be somehow held in a global state (useContext)? I understand that this description is vague, perhaps intentionally; I just need a push in the right direction for how to keep building out my little site.

gz919
  • 51
  • 4
  • I don't think `Context` would be necessary in your case. Let's say each of your projects has a tag or something like "coding", "design", etc. You can create a state that holds all the projects and another one that will hold your filtered works by the selected tag. The last one would be the one you would display depending on what filter the user selects, you will set this state accordingly checking if the project's tag includes "coding" or "design" for example. – ivanatias Jul 27 '22 at 20:37

0 Answers0