Loading tutorials
useState cover them in detail. Here you only need the mental model that the rest of React builds on.4 min readsrc folder of a Vite Re4 min readuseState, and the mistakes that most often go wrong with it. It assumes you know JavaScript functions, objects, arrays and ES modules. It also assumes you have read the earlier chapters on components, JSX and props.5 min readimport and export), and basic HTML. You should also have met JSX and components in the earlier chapters. Here you will see why a React project cannot run directly in the browser, and what a build tool does about that.4 min readimport and export). It also assumes you have a basic idea of what a React component and JSX are. You do not need to have installed Vite yet. The next chapters cover setup.6 min readnpm create vite@latest in the next chapter, and to fix the usual problems befor5 min readcreate vite. It assumes you know JavaScript modules, can use a terminal, and have Node.js and npm installed (the previous chapter covered checking them). It also assumes you know what a component is and why React projects need a build tool.5 min readnpm create vite@latest my-app -- --template react produces. It assumes you can read JavaScript modules and have run the scaffold command from the previous chapter. You should also know what a component and a prop are.4 min readimport and export).4 min readnpm create vite@latest and run npm install. It also assumes you know basic JavaScript modules and can use a terminal. Here you will start the Vite dev server, see how it serves your code, and learn how hot module replacement (HMR) u5 min readApp with your own, add a stateful Counter component, and watch hot updates in the browser.5 min readnpm run build produces, how npm run preview differs from the dev server, and the problems you are most likely to hit when you ship a Vite and React app. It assumes you have a scaffolded project that runs under npm run dev. It also assumes you know what package.json s6 min readvite.config.js. It assumes you can already scaffold a project with npm create vite@latest, and that you know ES module import and export syntax and the npm run scripts. You will learn what the default config does,4 min readnpm run dev and npm run build, and read vite.config.js. You should also know what a bundle is. The chapter covers how Vite exposes configuration values to your code, which values end up in the browser, and the mistakes that leak s4 min readnpm run dev, and run npm run build. It also assumes you know the basics of components, props and state. The goal is to help you decide whether a Vite single-page app is the right starting point for a given project, or whe6 min read