Skip to main content

Posts

Showing posts from January, 2020

Navigation Bar CSS

Navigation Bar CSS Create a navbar using CSS features such as flex and transition. Watch the video.

Error: Invariant failed: You should not use outside a Solution

Solution to error - Error: Invariant failed: You should not use <Switch> outside a <Router> If you are setting up routes using switch and getting the following error: Error: Invariant failed: You should not use <Switch> outside a <Router> Then in that case the solution is simple: wrap your switch with BrowserRouter and import it from react-router-dom See below for example: app.js import   React   from   'react' ; import  {  BrowserRouter ,  Route ,  Switch  }  from   'react-router-dom' ; import   HomePage   from   './components/pages/home/home.component' ; function   App () {    return  (      < div   className = "App" >        < BrowserRouter >          < Switch >            ...

ReactJS Basic App from Pune's Developer Vinit Khandelwal

Vinit Khandelwal is a MERN stack developer from Pune. He has extensive experience in MongoDB, NodeJS, ReactJS, AWS, GCP, and Python. Learn with his snippets on ReactJS and NodeJS. Hello World in ReactJS App Below example is all you need to launch a most basic app in React JS. app.js import React from 'react' ; import ReactDOM from 'react-dom' ; class App extends React . Component { render ( ) { return < h1 > Hello World! </ h1 > ; } } ReactDOM . render ( < App /> , document . getElementById ( 'root' ) ) ;