4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

Day 55

March 9th, 2018

Hello! Today the React for Beginners Course by Wes Bos I learned about routing in react.
First import:

            import { BrowserRouter, Route, Switch} from 'react-router-dom';

           import Router from "./components/Router";

in the index.js file.

           const Router = () => (
                 <BrowserRouter>
	                    <Switch>
		                    <Route exact path="/" component = {StorePicker}/>
		                   <Route exact path="/store/:storeId" component = {App}/>
		                   <Route component = {NotFound}/>
	                  </Switch>
                </BrowserRouter>
    );

I also learned about helper and utility functions.

    <input type="text" required placeholder="Store Name" defaultValue={getFunName()}/>

To get them into the right place.
Many things seem simpler in React, I am thinking of using it more in the future.

Cheers!

1 upvotes $0.00

Replies (0)

Conversation

No replies yet

Replies will appear here as people join the conversation.

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: