04. Hello Bootstrap πŸ‘©β€πŸŽ“πŸ‘¨β€πŸŽ“

HelloBootstrap

In this activity, we will utilize Bootstrap CSS and render components utilizing Bootstrap classes.

Instructions

  • Replace your application’s src folder with starter/src. Stop the dev server if it is already running.

  • Run npm install --save bootstrap in your command line to install Bootstrap.

  • Add import 'bootstrap/dist/css/bootstrap.min.css'; to the index.js file.

  • Start the app in dev mode by running npm start.

  • Create a components folder and inside it create a brand new file named HelloBootstrap.js. Add code to this file to accomplish the following:

  • Update the src/App.js file so that it imports the src/components/HelloBootstrap.js file. Render the HelloBootstrap component instead of the text that is currently being rendered.

Hints

  • In order to return separate JSX elements from a function, all of the higher-level elements need a single parent (e.g., usually a div).

  • All JSX tags must either have an adjacent tag or else have a self-closing forward slash.

  • className must be used to describe an element’s class property since class is a reserved word in JavaScript.

  • Remember to import the react library in any file where JSX is utilized. Inspect some of the other files provided with the starter code if you’re having difficulty remembering the syntax for this.

BONUS

  • Instead of having all of your Bootstrap code inside of a single component, create three separate components for the navbar, jumbotron, and card. Render these components inside of the App component.