Skip to content

Commit 40844c7

Browse files
committed
updated readme
1 parent 31ec1c2 commit 40844c7

1 file changed

Lines changed: 111 additions & 28 deletions

File tree

readme.md

Lines changed: 111 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,120 @@
11
# React Typescript by sample
22

3-
Due to the popularity of this repo [Jehu Sagardoy](https://github.com/jsagardoy) is getting them up to date, right now migrated from 00 to 13.
3+
The goal of this project is to provide a set of simple samples, providing and step by step guide to
4+
start working with React and Typescript.
5+
6+
We have incorporated a set of examples based on hooks.
7+
8+
Right now you got two main folders:
9+
10+
- Hooks: set of samples migrated to hooks (right now 11 samples migrated), if you are new to
11+
React, or you are going to start working on a new project, I recommend you going through these
12+
examples.
13+
14+
- Old_class_components_samples: The old samples, just in case you need to work with older react
15+
versions or you need to maintain legacy code.
416

517
You can check as well other repos (react / redux + typescript):
6-
- [React By Sample](https://github.com/Lemoncode/react-by-sample)
7-
- [Redux By Sample](https://github.com/Lemoncode/redux-by-sample)
8-
- [From React to Redux](https://github.com/Lemoncode/from-react-to-redux-ts)
9-
- [Redux Testing Typescript](https://github.com/Lemoncode/redux-testing-typescript)
1018

11-
# Samples
19+
- [React By Sample](https://github.com/Lemoncode/react-by-sample)
20+
- [Redux By Sample](https://github.com/Lemoncode/redux-by-sample)
21+
- [From React to Redux](https://github.com/Lemoncode/from-react-to-redux-ts)
22+
- [Redux Testing Typescript](https://github.com/Lemoncode/redux-testing-typescript)
23+
24+
# Examples
1225

1326
The goal of this project is to provide a set of simple samples, providing and step by step guide to
1427
start working with React and Typescript. Characteristics:
1528

16-
+ Bundling based on webpack.
17-
+ React + Typescript based.
18-
+ Simple navigation using react-router.
19-
+ Managing async calls and updates.
20-
+ Using Redux library.
21-
+ Handling async calls via Redux-Thunk + Redux Saga.
22-
+ Adding unit testing support.
23-
+ Implementing Lazy Loading.
24-
+ ...
25-
26-
## To get started:
27-
1. Install [NodeJS](http://www.nodejs.org)
29+
- Bundling based on webpack.
30+
- React + Typescript based.
31+
- Simple navigation using react-router.
32+
- Managing async calls and updates.
33+
- Using Redux library (not available yet on hooks version, coming soon).
34+
- Handling async calls via Redux-Thunk + Redux Saga (not available yet on hooks version, coming soon)
35+
- Adding unit testing support (not available yet on hooks version, coming soon).
36+
- Implementing Lazy Loading (not available yet on hooks version, coming soon).
37+
- ...
38+
39+
## To get started:
40+
41+
1. Install [NodeJS](http://www.nodejs.org)
2842
2. Download this repo
29-
5. Open the command line of your choice and cd to a sample directory within this repo on your machine
30-
6. `npm install` - Installs packages
31-
7. `npm start` - Builds the project and launch a lite web server (webpack-dev-server).
32-
8. Navigate to [http://localhost:8080/](http://localhost:8080/) if your browser doesn't open automatically.
43+
3. Open the command line of your choice and cd to a sample directory within this repo on your machine
44+
4. `npm install` - Installs packages
45+
5. `npm start` - Builds the project and launch a lite web server (webpack-dev-server).
46+
6. Navigate to [http://localhost:8080/](http://localhost:8080/) if your browser doesn't open automatically.
3347

3448
# samples
3549

50+
## Hooks
51+
52+
### [00 Boiler plate](./hooks/00_BoilerPlate/readme.md)
53+
54+
Bundling + npm start based on webpack.
55+
56+
### [01 Hello React](./hooks/01_HelloReact/readme.md)
57+
58+
Display the text 'Hello React'.
59+
60+
Hello world, simples react render sample.
61+
62+
### [02 Properties](./hooks/02_Properties/readme.md)
63+
64+
Display the text 'Hello {name}' (where name is a prop
65+
that contains a given name).
66+
67+
Introduce a basic React concept, handling properties.
68+
69+
### [03 State](./hooks/03_State/readme.md)
70+
71+
Starting from sample 02, Let's the user change the name to be displayed.
72+
73+
Introduce a basic React concept, handling State using hooks.
74+
75+
### [04 Callback](./hooks/04_Callback/readme.md)
76+
77+
Starting from sample 03, let the user change the name only
78+
when he hits a _change_ button.
79+
80+
Using callbacks.
81+
82+
### [05 Refactor](./hooks/05_Refactor/readme.md)
83+
84+
Refactor sample 04, cleanup and discussion on where to place the state.
85+
86+
Refactor the job done.
87+
88+
### [06 Enable](./hooks/06_Enable/readme.md)
89+
90+
Starting from sample 05, enable / disable the _change_ button
91+
when the text is empty or same name as original name,.
92+
93+
Enable/disable components.
94+
95+
### [07 ColorPicker](./hooks/07_Colorpicker/readme.md)
96+
97+
Simple color picker demo (show how properties work).
98+
99+
### [08 ColorPicker Refactor](./hooks/08_ColorPickerRefactor/readme.md)
100+
101+
ColorPicker refactor.
102+
103+
### [09 Sidebar](./hooks/10_Sidebar/readme.md)
104+
105+
Implementation of a single sidebar.
106+
107+
### [10 Table Mock](./hooks/11_TableMock/readme.md)
108+
109+
Render a table and use a child component to render each row, using mock data.
110+
111+
### [11 Table Axios](./hooks/12_TableAxios/readme.md)
112+
113+
Starting from sample 10, remove mock data, hit a real REST API (Github api), use
114+
axios to perform the fetch call.
115+
116+
## Old Class folder
117+
36118
## 00 Boiler plate
37119

38120
Bundling + npm start based on webpack.
@@ -45,12 +127,10 @@ Hello world, simples react render sample.
45127

46128
Creating a common header and about page react components.
47129

48-
49130
## 03 Navigation
50131

51132
Creating a "members" page, adding navigation using react-router.
52133

53-
54134
## 04 Display data
55135

56136
Create a read only list component (table >> tr >> td), reading list of members
@@ -72,14 +152,14 @@ In this sample we will add a link in the members page that will navigate to a
72152
"new member page". This new page will display a form where you have to enter
73153
the avatar url, login and id of a new member (just supossing we can edit that info).
74154

75-
## 08 ParamNavigation + Validations
155+
## 08 ParamNavigation + Validations
76156

77157
Edit a given member, here we learn how to add params to a navigation link and
78158
how to obtain them from a component.
79159

80160
Validation performed so far:
81161

82-
* Login: required, must be a string (at least length 3).
162+
- Login: required, must be a string (at least length 3).
83163

84164
## 09 Redux
85165

@@ -97,12 +177,10 @@ To have a global count of promises gong on we are using [reat-promise-tracker](h
97177

98178
Sample updated using Jest.
99179

100-
101180
## 12 Testing actions
102181

103182
Sample updated using Jest.
104183

105-
106184
## 13 Testing components (Containers and Presentationals)
107185

108186
Pending update Jest + Enzyme
@@ -127,6 +205,11 @@ Pending update
127205

128206
Replace class components by stateless components using Hooks.
129207

208+
# Contributors
209+
210+
Special thanks to [Jehu Sagardoy](https://github.com/jsagardoy) for his contributions checking
211+
and getting uptodate examples.
212+
130213
# About Basefactor + Lemoncode
131214

132215
We are an innovating team of Javascript experts, passionate about turning your ideas into robust products.

0 commit comments

Comments
 (0)