Skip to content
Snippets Groups Projects
Commit 07f222b9 authored by Viarezo's avatar Viarezo
Browse files

new readme

parent 5e6189e9
No related branches found
No related tags found
No related merge requests found
# Getting Started with Create React App # Qu'est ce que c'est ?
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). Ce code est celui que j'ai utilisé pour faire la formation aux bases de React le 11 octobre 2021. La formation elle-même a été enregistrée et est disponible à la demande.
## Available Scripts # Comment lire cette formation dans le bon ordre ?
In the project directory, you can run: Après avoir cloné ce repo (cf le bouton du gitlab qui vous explique comment faire), executez les commandes suivantes :
```
*cd formation-react-pitoune
*git checkout step1
*yarn start
```
Vous vous trouvez maintenant dans la version la plus simple d'un site en React. Vous pouvez ensuite vous déplacer de branche en branche de ```step1``` à ```step4``` puis ```master``` pour découvrir les différents aspects de React un par un.
Il est conseillé de suivre la vidéo en parallèle pour comprendre les différentes étapes de la construction du site.
### `yarn start` # Esthétique et trucs qui servent à rien
Runs the app in the development mode.\ Si ça vous intéresse, vous pouvez observer que j'utilise Bootstrap (un framework CSS) pour avoir des cartes jolies et Nunito qui est une font que j'aime bien
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\ # TP possible
You will also see any lint errors in the console.
### `yarn test` Une fois que tout est bien compris, une super façon de se lancer est d'essayer de tout refaire soi-même, étape après étape ce que je fais. Chaque step est un peu plus compliqué que le précédent, pas de pression si vous bloquez donc. Une fois toutes les étapes abatues et comprises, vous maitrisez les bases universelles du React : Félicitations ;)
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `yarn build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `yarn eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
### Analyzing the Bundle Size
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
### Making a Progressive Web App
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
### Advanced Configuration
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
### Deployment
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
### `yarn build` fails to minify
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
import { useState } from "react"; import { useState } from "react";
const Counter = (props) => { const Counter = (props) => {
/* const [count, setCount] = useState(0); const [count, setCount] = useState(0);
const whenUclick = () => setCount(count+1);*/ const whenUclick = () => setCount(count+1);
let lecompte = 0;
const quantuclic = () => lecompte = lecompte+1;
return ( return (
<div class="card" style={{width:"auto", margin: '2em'}}> <div class="card" style={{width:"auto", margin: '2em'}}>
<div class="card-header"> <div class="card-header">
...@@ -13,12 +11,12 @@ const Counter = (props) => { ...@@ -13,12 +11,12 @@ const Counter = (props) => {
<button <button
type="button" type="button"
class="btn btn-primary" class="btn btn-primary"
onClick={quantuclic} onClick={whenUclick}
style={{margin: "1em"}} style={{margin: "1em"}}
> >
Ce bouton incrémente Ce bouton incrémente
</button> </button>
<p style={{margin: "1em auto"}}> genre ça vaut {lecompte}</p> <p style={{margin: "1em auto"}}> genre ça vaut {count}</p>
</div> </div>
) )
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment