If you click on the Add Room button, then one card will be added on the screen. Save the file and start the React development server using the following command. Syntax function Welcome(props) from './components/HotelList' But you can also use the ES6 syntax to write components. ![]() The functional component is just a function that accepts props and returns a React element. ![]() We will create HotelCard.js as a function component because it does not deal with any data. We will create a HotelList.js as a class-based React Component because it deals with the state. Inside that folder, create two components. Inside the src folder, create a new directory called components. Using React, we can design simple views for each state in our application, and React will efficiently update and render just the right components when our data changes.ĭeclarative views make our code more predictable and easier to debug. React makes it painless to create interactive User Interfaces(UIs). React uses an XML-like syntax called JSX. ![]() Import 'bootstrap/dist/css/' Īs you can see, we have imported file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |