• Stars
    star
    1,847
  • Rank 24,911 (Top 0.5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

React Typescript by sample

🇪🇸 Versión Español

The goal of this project is to provide a set of simple samples, providing and step by step guide to start working with React and TypeScript.

We have incorporated a set of examples based on hooks.

Right now you got two main folders:

  • Hooks: set of samples migrated to hooks (right now 15 samples migrated), if you are new to React, or you are going to start working on a new project, We recommend you going through these examples.

  • Old_class_components_samples: The old samples, just in case you need to work with older react versions or you need to maintain legacy code.

If you want to make a deeper dive on React Hooks you can check this repo React Hooks By Example

Other guided repos available (react / redux + typescript):

Examples

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

  • Bundling based on webpack.
  • React + Typescript based.
  • Simple navigation using react-router.
  • Managing async calls and updates.
  • Using Redux library (not available yet on hooks version, coming soon).
  • Handling async calls via Redux-Thunk + Redux Saga (not available yet on hooks version, coming soon)
  • Adding unit testing support (not available yet on hooks version, coming soon).
  • Implementing Lazy Loading (not available yet on hooks version, coming soon).
  • ...

To get started:

  1. Install NodeJS
  2. Download this repo
  3. Open the command line of your choice and cd to a sample directory within this repo on your machine
  4. npm install - Installs packages
  5. npm start - Builds the project and launch a lite web server (webpack-dev-server).
  6. Navigate to http://localhost:8080/ if your browser doesn't open automatically.

samples

Hooks

Bundling + npm start based on webpack.

Display the text 'Hello React'.

Hello world, simples react render sample.

Display the text 'Hello {name}' (where name is a prop that contains a given name).

Introduce a basic React concept, handling properties.

Starting from sample 02, let's the user change the name to be displayed.

Introduce a basic React concept, handling State using hooks.

Starting from sample 03, let the user change the name only when he hits a change button.

Using callbacks.

Refactor sample 04, cleanup and discussion on where to place the state.

Refactor the job done.

Starting from sample 05, enable / disable the change button when the text is empty or same name as original name,.

Enable/disable components.

Simple color picker demo (show how properties work).

ColorPicker refactor.

Implementation of a single sidebar.

Render a table and use a child component to render each row, using mock data.

Starting from sample 10, remove mock data, hit a real REST API (Github api), use axios to perform the fetch call.

Starting from sample 03,start using React-Router (SPA navigation).

Starting from sample 12, implement a basic login page, that will redirect the user to another page whenever the login has completed successfully.

Starting from sample 13, add validation support to login form.

Starting from sample 14, learn how React 16 context api works.

Old Class folder

00 Boiler plate

Bundling + npm start based on webpack.

01 Hello React

Hello world, simples react render sample.

02 Components

Creating a common header and about page react components.

03 Navigation

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

04 Display data

Create a read only list component (table >> tr >> td), reading list of members from a fake api and dumping it into component state.

05 Presentational Components

Breaking the list component into two: list and row compomenent, member row entity passed via props.

06 Handling asynchronous calls

Members fake api replaced with async call to api github to retrieve list of members of a given organization.

07 Forms

In this sample we will add a link in the members page that will navigate to a "new member page". This new page will display a form where you have to enter the avatar url, login and id of a new member (just supossing we can edit that info).

08 ParamNavigation + Validations

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

Validation performed so far:

  • Login: required, must be a string (at least length 3).

09 Redux

Added Redux support, isolated state into Redux reducers, implement load, save, basic validation cycle. This sample uses the fake api, in following samples we will call async operations and fitting them into Redux architecture.

10 SpinnerAsync

Display a busy indicator while an ajax request is in progress.

To have a global count of promises gong on we are using react-promise-tracker and to display a cool spinner react-spinner

11 Testing reducers

Sample updated using Jest.

12 Testing actions

Sample updated using Jest.

13 Testing components (Containers and Presentationals)

Pending update Jest + Enzyme

14 Replacing Redux Thunk with Redux Saga

Pending update

15 Lazy Loading and React-Router

Pending update

16 Add custom middlewares

Pending update

17 Add support for ReactHotloader and ReduxDev Tools.

Pending update

18 Hooks

Replace class components by stateless components using Hooks.

19 LoginForm

Add a login page using Material-UI.

Contributors

Thank you very much to the contributors for keeping the project updated in all the examples.

About Basefactor + Lemoncode

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

Basefactor, consultancy by Lemoncode provides consultancy and coaching services.

Lemoncode provides training services.

For the LATAM/Spanish audience we are running an Online Front End Master degree, more info: http://lemoncode.net/master-frontend

More Repositories

1

react-hooks-by-example

The goal of this project is to provide a set of react hooks step by step guided examples, coverting from starter scenarios to advanced topics.
JavaScript
363
star
2

redux-sagas-typescript-by-example

Set of step by step guided samples to help you get started with redux sagas + typescript
TypeScript
288
star
3

react-promise-tracker

Simple promise tracker React Hook and Hoc. https://lemoncode.github.io/react-promise-tracker/
JavaScript
204
star
4

react-by-sample

Set of basic React + Typescript guided samples, cover basic principles of this technology.
TypeScript
202
star
5

webpack-by-sample

Learn webpack by sample, each of the samples contains a readme.md file that indicates the purpose of the sample plus an step by step guide to reproduce it.
JavaScript
189
star
6

master-frontend-lemoncode

Master Front End Online Lemoncode Demos source code + step by step guides
TypeScript
155
star
7

fonk

Form schema validation library
TypeScript
138
star
8

redux-by-sample

The goal of this project is to provide a set of step by step guided samples, covering core concepts of React + Redux (basic concepts, middleware, ...)
TypeScript
130
star
9

vuejs-by-sample

The goal of this project is to provide a set of step by step samples, covering core concepts of Vue.js
TypeScript
71
star
10

react-testing-by-example

JavaScript
68
star
11

mongo-modeler

Mongo Modeler is a free, open source online web application that allows you to design and model MongoDB databases.
TypeScript
59
star
12

lcFormValidation

Javascript based form validation library, third party library / framework agnostic.
TypeScript
58
star
13

i18next-example-typescript

n this example we are going to start form a simple login application and add multilanguage support.
TypeScript
55
star
14

jest-testing-by-sample

Learn testing by sample using Jest, each of the samples contains a readme.md file that indicates the purpose of the sample plus an step by step guide to reproduce it.
TypeScript
48
star
15

parcel-by-sample

Learn parcel by sample, each of the samples contains a readme.md file that indicates the purpose of the sample plus an step by step guide to reproduce it.
HTML
45
star
16

jest-vs-code-debugging-example

JavaScript
42
star
17

d3js-typescript-examples

Chart Examples using d3js + Typescript
CSS
41
star
18

from-react-to-redux-ts

Implementing a simple list application in a progressive way
TypeScript
40
star
19

integrate-react-legacy-apps

Migration from Legacy projects to React guide samples
JavaScript
39
star
20

nextjs-typescript-by-sample

Set of guided samples about how to get started with nextjs + typescript
TypeScript
39
star
21

git-from-ui-to-terminal

HTML
37
star
22

webinar-es6

36
star
23

code-paster

TypeScript
36
star
24

pragmatic-drag-and-drop-tutorial-typescript

porting Pragamatic Drag & Drop tutorial to TypeScript
TypeScript
36
star
25

bootcamp-devops-lemoncode

TypeScript
33
star
26

webinar-typescript

JavaScript
31
star
27

manfred-export-app

TypeScript
28
star
28

language-sessions

JavaScript
28
star
29

webpack-1.x-by-sample

Learn webpack 1.x by sample
JavaScript
27
star
30

LeanMood

TypeScript
27
star
31

english-quiz

TypeScript
26
star
32

webinar-github-actions

HTML
25
star
33

react-image-focal-point

Let the user set the picture focal point just by visually dragging and dropping on top of the selected image.
TypeScript
25
star
34

planning-poker-example

TypeScript
23
star
35

movies-pods

Sample app, using redux / pods / react / typescript
TypeScript
20
star
36

react-by-sample-es6

Es6 version of original typescript react by sample repo
JavaScript
19
star
37

node-training

JavaScript
19
star
38

Angular-Architecture-Fundamentals

This repository will cover Angular techniques to manage state and use the best practices provided by Angular team
TypeScript
17
star
39

fonk-formik

This package serves as the entry point to the Formik Form state management library. It is intended to be paired with the generic Fonk package, which is shipped as to npm.
TypeScript
17
star
40

angular-5-sample-app

Complete Angular 5 app that will help you to start with the ain topics of the framework
17
star
41

angular2-sample-app

[Work in progress] Simple LOB app includes login, list, form edit
TypeScript
17
star
42

quickmock

TypeScript
17
star
43

d3js-samples

Somes simple d3js samples
16
star
44

k8s-fundamentals

Kubernetes course from cero knowledge to proactive Kubernetes user as developer
TypeScript
15
star
45

bootcamp-backend

TypeScript
15
star
46

gatsby-by-sample

Base project to use Gatsby, Contentful and Netlify
TypeScript
15
star
47

react-alicante-hooks-workshop

React Alicante Workshop Demo Material https://reactalicante.es/
HTML
14
star
48

async-javascript-fundamentals

Getting started with the concurrency model on JavaScript
JavaScript
14
star
49

scaffolding-express-typescript

Babel + Typescript + Express
CSS
14
star
50

lemon-front-estructura

13
star
51

redux-testing-typescript

Guide to add unit test support to your redux project (typescript based).
TypeScript
13
star
52

react-from-classes-to-hooks-typescript

Sample simple applications migrations from class based components to hooks
TypeScript
13
star
53

simplechart

Simplechart seed
TypeScript
12
star
54

simple-hotels-mock-rest-api

A very simple local test rest-api, ideal to make quick front end examples, or to share with students.
12
star
55

angular1_5-sample-app

[Work in progress] Simple LOB app includes login, list, form edit —
TypeScript
12
star
56

webinar-kubernetes

HTML
12
star
57

promises-ts-samples

TypeScript
11
star
58

redux-chat-front

JavaScript
11
star
59

react-training-es6

JavaScript
11
star
60

lc-validation-summary

Angular directive for providing a validation summary to angular based forms.
JavaScript
11
star
61

layout-samples

CSS
11
star
62

react-lab-sessions

TypeScript
11
star
63

fonk-final-form

This package serves as the entry point to the React Final Form library. It is intended to be paired with the generic Fonk package, which is shipped as to npm.
TypeScript
11
star
64

CSS_Samples

CSS
10
star
65

react-form-validation

React hook implementation to easify using lc-form-validation
TypeScript
10
star
66

webinar-vuejs-typescript

The goal of this project is to provide a set of step by step samples, covering core concepts of Vue.js with TypeScript
Vue
10
star
67

bar.io

TypeScript
10
star
68

XFormsPushNotifications

Source code for the tutorial: Adding Push Notifications to your Xamarin Forms app Parts 1 and 2
C#
10
star
69

beer-geek-menu

TypeScript
9
star
70

redux-2023

TypeScript
9
star
71

react-training-ts

TypeScript
8
star
72

language-exercises

Master Front-End Lemoncode | Exercises for module Languages
TypeScript
8
star
73

angular-6-sample-app

Application focused on Angular 6
8
star
74

treeshaking-samples

Some sample about how to proper add tree shaking when using popular libraries like material-ui
JavaScript
8
star
75

gulp4-by-sample

[work in progress] Step by step guided samples gulp 4
JavaScript
8
star
76

redux-chat-back

JavaScript
8
star
77

vuejs-typescript-lob-examples

Vuejs + Typescript Line of business applications guided examples
Vue
7
star
78

angular-architecture-essentials

Repository to show the main architecture areas, components, DI and routing
TypeScript
7
star
79

react-promise-tracker-workshop

TypeScript
7
star
80

componentization-examples

Simple ui componentization example plus excercise
TypeScript
7
star
81

grunt-by-sample

Just some simple step by step guided samples to help you on getting started with grunt
JavaScript
7
star
82

demosBootstrap3

Basic training material Bootstrap 3 (building a layout)
HTML
7
star
83

graphql-by-sample

A repository to teach GraphQL technology
TypeScript
6
star
84

typescript-sandbox

CSS
6
star
85

css4-training

Basics for css4 grid and flexbox training
CSS
6
star
86

react-simple-testing

TypeScript
6
star
87

git-training-2023

HTML
6
star
88

origin-front-admin

TypeScript
5
star
89

redux-by-sample-es6

Port from redux by sample (typescript) to Ecmascript 6
JavaScript
5
star
90

ngrx-by-sample

Angular ngrx example application, step by step
TypeScript
5
star
91

vuejs-excercise

Simple vuejs excercise to get your hands wet on code
Vue
5
star
92

lc-validator-dni

DNI validator for
TypeScript
5
star
93

fonk-iban-validator

IBAN validator for https://github.com/Lemoncode/fonk
TypeScript
5
star
94

javascript-sandbox

CSS
5
star
95

Angular_Testing

A project to deal with unit testing in Angular 5
TypeScript
5
star
96

sesion-componentes-accesibles

TypeScript
4
star
97

d3js-from-scratch

JavaScript
4
star
98

redux-excercise

Simple redux excercise to get your hands wet on code
TypeScript
4
star
99

use-route-matching

JavaScript
4
star
100

redux-workshop

TypeScript
4
star