E
E
embiid2019-07-15 14:54:01
JavaScript
embiid, 2019-07-15 14:54:01

How to display a component by URL?

There is one div block where the information changes depending on the URL link.

<div className="feed">

          <Route path="/Contact">
            <Contact firstWord="Contact" secndWord="Form" />
          </Route>

          <Route path="/" component = {About}>
          </Route>

        </div>

I have a problem with the first Route:
<Route path="/Contact">
            <Contact firstWord="Contact" secndWord="Form" />
</Route>

The Contact component has two properties and I don't know how to display it in the Route.
I tried to do this, but it gives an error:
<Route path="/Contact" component={ <Contact firstWord="Contact" secndWord="Form"></Contact> } ></Route>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2019-07-15
@embiid

We read the documentation .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question