React – Hello world

Vygenerování nové aplikace:

npx create-react-app hello-world

Spustit příkazem:

cd hello-world
npm start

Komponenty

npx generate-react-cli component Box

Do app.js přidat:

import Box from './components/Box/Box';
...
  return (
    <div className="App">
      <header className="App-header">
        <Box></Box>
      ...

npm start
Starts the development server.

npm run build
Bundles the app into static files for production.

npm test
Starts the test runner.

npm run eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!