|
Canada-0-RECUPERATION ไดเรกทอรีที่ บริษัท
|
ข่าว บริษัท :
- Getting Started | Create React App
Getting Started Create React App is an officially supported way to create single-page React applications It offers a modern build setup with no configuration Quick Start npx create-react-app my-app cd my-app npm start
- Adding TypeScript | Create React App
If you are currently using create-react-app-typescript, see this blog post for instructions on how to migrate to Create React App Constant enums and namespaces are not supported, you can learn about the constraints of using Babel with TypeScript here
- Updating to New Releases | Create React App
Create React App is divided into two packages: create-react-app is a global command-line utility that you use to create new projects react-scripts is a development dependency in the generated projects (including this one) When you run npx create-react-app my-app it automatically installs the latest version of Create React App
- Troubleshooting | Create React App
Troubleshooting npm start doesn’t detect changes When you save a file while npm start is running, the browser should refresh with the updated code If this doesn’t happen, try one of the following workarounds: Check that your file is imported by your entrypoint TypeScript will show errors on any of your source files, but webpack only reloads your files if they are directly or indirectly imported by one of your entrypoints If your project is in a Dropbox folder, try moving it out If
- Custom Templates | Create React App
Custom Templates enable you to select a template to create your project from, while still retaining all of the features of Create React App You'll notice that Custom Templates are always named in the format cra-template-[template-name], however you only need to provide the [template-name] to the creation command
- Creating a Production Build | Create React App
npm run build creates a build directory with a production build of your app Inside the build static directory will be your JavaScript and CSS files Each filename inside of build static will contain a unique hash of the file contents This hash in the file name enables long term caching techniques
- Folder Structure | Create React App
Folder Structure After creation, your project should look like this:
- Making a Progressive Web App | Create React App
Making a Progressive Web App The production build has all the tools necessary to generate a first-class Progressive Web App, but the offline cache-first behavior is opt-in only Starting with Create React App 4, you can add a src service-worker js file to your project to use the built-in support for Workbox 's InjectManifest plugin, which will compile your service worker and inject into it a list of URLs to precache If you start a new project using one of the PWA custom templates, you'll
- Using the Public Folder | Create React App
Only files inside the public folder will be accessible by %PUBLIC_URL% prefix If you need to use a file from src or node_modules, you’ll have to copy it there to explicitly specify your intention to make this file a part of the build When you run npm run build, Create React App will substitute %PUBLIC_URL% with a correct absolute path so your project works even if you use client-side routing or host it at a non-root URL In JavaScript code, you can use process env PUBLIC_URL for similar
- Adding a Router | Create React App
Create React App doesn't prescribe a specific routing solution, but React Router is the most popular one
|
|