Skip to content

Commit

Permalink
fix a lot a typo or errors + add slides/steps unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kuroidoruido committed May 27, 2024
1 parent 466a673 commit 6d505a0
Show file tree
Hide file tree
Showing 76 changed files with 2,091 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.14.0
v18
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ npm run client -- exo01
npm run client -- exo01-solution
```

> Steps require at least you have node v18 installed
### Start the slide

```bash
Expand Down
Binary file added docs/assets/images/keys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions docs/markdown/00-school/02-repository.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Repository

https://github.com/sfeir-open-source/sfeir-school-react <!-- .element: class="center" -->

##==##

# Requirements

- Node v18
- npm
- A IDE: VSCode or WebStorm recommanded
2 changes: 1 addition & 1 deletion docs/markdown/01-intro/00-TITLE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Introduction

Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/01-intro/10-app-discovery.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# App discovery

Expand Down
2 changes: 0 additions & 2 deletions docs/markdown/01-intro/12-advance-bootstraping-next.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ npx create-next-app

Server side rendering let you generate a client-side rendering application or universal application into HTML, then
make it interactive by executing the client side Javascript

<!-- .element: class="important" -->
2 changes: 1 addition & 1 deletion docs/markdown/01-intro/20-what-is-react.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# What is React?

Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/01-intro/30-virtual-dom.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Virtual DOM

Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/01-intro/40-jsx.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# JSX

Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/02-nodes-elements-components/00-TITLE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Nodes, Elements and components

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Component tree

Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/02-nodes-elements-components/21-props.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Props

Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/02-nodes-elements-components/23-children.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Children and Composition

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@
<br>

### npm run 02-composition

Notes:

- Debug: Show component tree with React DevTools
- Chrome: https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi
- Firefox: https://addons.mozilla.org/fr/firefox/addon/react-devtools/
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Conditionals
2 changes: 1 addition & 1 deletion docs/markdown/02-nodes-elements-components/40-lists.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Lists
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

# Lists

<div style="height:300px; width:60%; margin: 50px auto;">
<img class="full-height" src="./assets/images/keys.png">
</div>
![full-center h-300](assets/images/keys.png)
2 changes: 1 addition & 1 deletion docs/markdown/03-states-and-events/00-TITLE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# States & Events

Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/03-states-and-events/10-states.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# States
4 changes: 4 additions & 0 deletions docs/markdown/03-states-and-events/35-lab-state-clicks.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
Notes:

- LIVE CODING

- Debug: Show state display and state manipulations in React DevTools
- Chrome: https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi
- Firefox: https://addons.mozilla.org/fr/firefox/addon/react-devtools/
4 changes: 4 additions & 0 deletions docs/markdown/03-states-and-events/55-lab-list-and-fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@
Notes:

- LIVE CODING

- Debug: Show state updated with fetch in React DevTools
- Chrome: https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi
- Firefox: https://addons.mozilla.org/fr/firefox/addon/react-devtools/
2 changes: 1 addition & 1 deletion docs/markdown/04-lifecycle-et-dom/00-TITLE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Lifecycle & DOM

Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/04-lifecycle-et-dom/10-lifecycle.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Lifecycle

Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/04-lifecycle-et-dom/20-refs.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Refs

Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/05-custom-hooks-and-hoc/00-TITLE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Hooks custom et HOC

Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/05-custom-hooks-and-hoc/10-custom-hooks.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Custom Hooks

Expand Down
4 changes: 4 additions & 0 deletions docs/markdown/05-custom-hooks-and-hoc/15-lab-custom-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@
Notes:

- LIVE CODING

- Debug: Show how custom hook is shown in React DevTools
- Chrome: https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi
- Firefox: https://addons.mozilla.org/fr/firefox/addon/react-devtools/
2 changes: 1 addition & 1 deletion docs/markdown/05-custom-hooks-and-hoc/20-HOC.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# High Order Component
4 changes: 4 additions & 0 deletions docs/markdown/05-custom-hooks-and-hoc/25-lab-hoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@
Notes:

- LIVE CODING

- Debug: Show HOC in React DevTools
- Chrome: https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi
- Firefox: https://addons.mozilla.org/fr/firefox/addon/react-devtools/
4 changes: 4 additions & 0 deletions docs/markdown/06-routing-context-suspense/15-lab-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@
Notes:

- LIVE CODING

- Debug: Show router in React DevTools
- Chrome: https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi
- Firefox: https://addons.mozilla.org/fr/firefox/addon/react-devtools/
4 changes: 4 additions & 0 deletions docs/markdown/06-routing-context-suspense/25-lab-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@
Notes:

- LIVE CODING

- Debug: Show context in React DevTools
- Chrome: https://chromewebstore.google.com/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi
- Firefox: https://addons.mozilla.org/fr/firefox/addon/react-devtools/
2 changes: 1 addition & 1 deletion docs/markdown/07-formulaires/00-TITLE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Formulaires

Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/07-formulaires/10-vanilla.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Basis
2 changes: 1 addition & 1 deletion docs/markdown/07-formulaires/20-uncontrolled.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Uncontrolled VS Controlled

Expand Down
6 changes: 3 additions & 3 deletions docs/markdown/07-formulaires/30-react-hook-form.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# React Hook Form

Expand Down Expand Up @@ -50,7 +50,7 @@ function MyForm({ initialValue = {}, onSubmit }: MyFormProps) {
defaultValues:initialValue });
return <form onSubmit={handleSubmit(onSubmit)}>
<input {...register("firstname")} />;
<input {...register("lastname"), { required: true }} />;
<input {...register("lastname", { required: true })} />;
{errors.lastnameRequired && <span>Lastname field is required</span>}
<button type="submit">Save</button>
</form>
Expand All @@ -77,7 +77,7 @@ function MyForm({ initialValue = {}, onSubmit }: MyFormProps) {
const onSubmit: SubmitHandler<Inputs> = onSubmit;
return <form onSubmit={handleSubmit(onSubmit)}>
<input {...register("firstname")} />;
<input {...register("lastname"), { required: true }} />;
<input {...register("lastname", { required: true })} />;
{errors.lastnameRequired && <span>Lastname field is required</span>}
<button type="submit">Save</button>
</form>
Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/07-formulaires/40-formik.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Formik

Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/08-states/00-TITLE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Gestion d’états

Expand Down
4 changes: 2 additions & 2 deletions docs/markdown/08-states/10-use-reduce-hook.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# useReducer

Expand Down Expand Up @@ -30,7 +30,7 @@ function Button() => {
type ButtonReducerState = { clickCount: number };

function Button() => {
const [state, dispatch] = useReducer<ButtonReducerState>(reducer, { clickCount: 0 });
const [state, dispatch] = useReducer(reducer, { clickCount: 0 });

return <button onClick={() => dispatch('CLICK')}>
clicked {state.clickCount} times
Expand Down
3 changes: 3 additions & 0 deletions docs/markdown/08-states/15-lab-use-reduce-hook.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@
Notes:

- LIVE CODING
- Debug: show useReduce state with React Context DevTools
- Chrome: https://chromewebstore.google.com/detail/react-context-devtool/oddhnidmicpefilikhgeagedibnefkcf
- Firefox: https://addons.mozilla.org/fr/firefox/addon/react-context-devtool/
2 changes: 1 addition & 1 deletion docs/markdown/08-states/20-redux.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Redux

Expand Down
6 changes: 3 additions & 3 deletions docs/markdown/08-states/21-redux-toolkit.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Redux Toolkit

Expand Down Expand Up @@ -50,7 +50,7 @@ interface TodosReducerState {

export const todosSlice = createSlice({
name: 'todos',
initialState: { todos: [] },
initialState: { todos: [] } as TodosReducerState,
reducers: {
add: (state, action: PayloadAction<string>) => {
state.todos.push({ text: action.payload });
Expand Down Expand Up @@ -106,7 +106,7 @@ export const navigateTo = createAction<string>('navigateTo');
```typescript [7,13|8,12|9-11|7-13]
export const todosSlice = createSlice({
name: 'todos',
initialState: { todos: [] },
initialState: { todos: [] } as TodosReducerState,
reducers: {
/* ... */
},
Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/08-states/22-react-redux.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# React-Redux

Expand Down
3 changes: 3 additions & 0 deletions docs/markdown/08-states/25-lab-redux.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
Notes:

- LIVE CODING
- Debug: show state with Redux DevTools
- Chrome: https://chromewebstore.google.com/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd
- Firefox: https://addons.mozilla.org/fr/firefox/addon/reduxdevtools/?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=search
2 changes: 1 addition & 1 deletion docs/markdown/08-states/30-redux-and-async.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Redux & Async

Expand Down
4 changes: 2 additions & 2 deletions docs/markdown/08-states/31-redux-thunk.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Redux Thunk

Expand Down Expand Up @@ -69,7 +69,7 @@ const fetchTodosById = createAsyncThunk('todos/fetchById',
```typescript [7,13|8,12|9-11|7-13]
export const todosSlice = createSlice({
name: 'todos',
initialState: { todos: [] },
initialState: { todos: [] } as TodosReducerState,
reducers: {
/* ... */
},
Expand Down
4 changes: 2 additions & 2 deletions docs/markdown/08-states/32-redux-saga.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Redux Thunk
# Redux Saga

##==##

Expand Down
2 changes: 2 additions & 0 deletions docs/markdown/08-states/35-lab-redux-thunk.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
Notes:

- LIVE CODING
- Debug: show query DevTools
- https://tanstack.com/query/latest/docs/framework/react/devtools
2 changes: 1 addition & 1 deletion docs/markdown/08-states/40-react-query.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# @tanstack/react-query

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- .slide: class="transition bg-pink" -->
<!-- .slide: class="transition" -->

# Bibliothèques de composants et testing

Expand Down
Loading

0 comments on commit 6d505a0

Please sign in to comment.