taniarascia / comments

Comments
7 stars 0 forks source link

using-react-router-spa/ #94

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Using React Router for a Single Page Application | Tania Rascia

React doesn't come with a built-in router, but we can easily achieve routing with the library. Routing is how a web applications direct…

https://www.taniarascia.com/using-react-router-spa/

HeflerDev commented 3 years ago

Awesome! This is helping me a lot.

papijo commented 2 years ago

I have a question about user.loading. I know it is true in the initialState when the User object is empty. Does the user object being populated with data from the API change the boolean value from true to false because i dont see anywhere in the code where it changes.

beyond88 commented 2 years ago

I couldn't run this code. Getting this error: ./src/App.js Attempted import error: 'Switch' is not exported from 'react-router-dom'.

mcsmik commented 1 year ago

I also couldn't run the code due to

export 'Switch' (imported as 'Switch') was not found in 'react-router-dom'

mcsmik commented 1 year ago

Looks like Switch has been deprecated in favour of 'Routes', so importing that instead and using it works