It tests that our App component successfully displays a link with the text "learn react". It includes all of the packages you need to run tests using the React Testing Library ( basic test is included in the file in src. How to Run Tests with the React Testing LibraryĬreate React App makes it very simple to test your React app. Note: The only time you may need to refresh the browser when working with Create React App is when you have an error. There is no need to manually refresh the browser. What is great about the development server is that it automatically refreshes to reflect our changes. When you save by using Command/Ctrl + S, you will see our page immediately update to look like this: In particular, let's remove the p and a tags, and add an h1 element with the name of our app, "React Posts Sharer": // src/App.js If we head over to that file, we can start making changes to our app code. It's coming from the App.js file within the src folder. The development server will start up on localhost:3000 and, right away, we can see the starting home page for our app. When we run our project, a new browser tab will automatically open on our computer's default browser to view our app. To start your React project, you can simply run: npm start Once you have dragged your project into your code editor, you can open up your terminal (in VSCode, go to View > Terminal). You can start saving changes to your app right away using git add. Note: A new Git repository is created whenever you make a new project with Create React App. It is where all of our React-related code will live and is what we will primarily work in to build our app.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |