0

I am successfully rendering a component to an authenticated route.

If a condition is met, I would like to render that same component -- with the addition of a certain prop value -- to a different, unauthenticated route.

Can I render concurrently two variations of a single component to two distinct routes using only React and React Router? How is this done?

David
  • 1
  • 3
  • Possible duplicate https://stackoverflow.com/questions/42474176/using-conditional-component-with-the-same-route-path-in-reactjs – Paul McLoughlin Apr 16 '18 at 22:36
  • Not quite -- part of the problem is I'm unable to define the problem clearly. The context is that I'm trying to render a text input component on a private page and then again read-only on a public page when published. I can of course render the two components on the same page, but can't conceptually understand how to render one component over here and another component over there at the same time. – David Apr 17 '18 at 00:39

1 Answers1

0

The answer was on the backend. Since I am using a serverless configuration, I wrote one lambda for an authenticated (private) user and another lambda for an unauthenticated (public) user.

David
  • 1
  • 3