Making Components

 Making Components


1. Create components folder inside src folder
2. Lets create component for navbar, so for that create Navbar.js inside component folder 
[NOTE: first letter should always  be capital]

3. Type rfc and hit enter
4. Inside return Build your Navbar, paste bootstrap navbar inside<></> and replace all text "class" with "className"
and put /> as a closing tag is the tag doesnt have closing ta (eg : <hr className="dropdown-divider"/>)
replace by using CTRL+F also replace [a href="#" to a href="/"]

5. Goto App.js write at top ( import Navbar from './components/Navbar'; )

6. Write <Navbar/>
7. See your site, from compoenent your navbar has created
8. Similarly create component for different body items and put inside App.js by importing at top


[If you put component inside App.js which doesnt exist then Your whole site may look blank]

Comments