David Borzek
# npm 6.x
npm create vite@latest my-react-app --template react-ts
# npm 7+, extra double-dash is needed:
npm create vite@latest my-react-app -- --template react-ts
# yarn
yarn create vite my-react-app --template react-ts
# pnpm
pnpm create vite my-react-app --template react-ts
You can define custom props for your component, so it can be rendered dynamically.
Props can be accessed through the `props` parameter of your components function.
Strings and numbers can be rendered directly. Other values must be mapped.
Hooks let you use different React features from your components. You can either use the built-in Hooks or combine them to build your own.
Holds information which isn't used for re-rendering. Often used to hold a DOM node.
Effects let a component connect to and synchronize with external systems. This includes dealing with network, browser DOM, animations, widgets written using a different UI library, and other non-React code.
Note: unlike in HTML, the name of the corresponding prop in JSX is not `class`, but `className`
Classnames are imported as object. The final classnames are randomly generated (e.g `HelloWorldComponent_helloWorld_2cvf73`).
Allows usage of JavaScript variables. CSS classes are generally better for performance than inline styles.