React is the entry point to the React library.
- If you use ES6 with npm, you can write
import React from 'react'
- If you use ES5 with npm, you can write
var React = require('react')
- If you load React from a
<script>
tag, these top-level APIs are available on the React global:
<script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
The versions above are only meant for development, and are not suitable for production. Minified and optimized production versions of React are available at:
<script crossorigin src="https://unpkg.com/react@17/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script>
render() {
// Note: this is an escape hatch and should be used sparingly!
// Normally we recommend using `import` for getting asset URLs
// as described in “Adding Images and Fonts” above this section.
return <img src={process.env.PUBLIC_URL + '/img/logo.png'} />;
}
Or: <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
https://create-react-app.dev/docs/using-the-public-folder
⚡️
delete all files in a directory: rm -f *
or del *