Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Vitaminvp/react-patterns

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-patterns 😺

Kottans report

(still in the process of writing)

Preview link

Presentation

В репозитории собраны примеры некоторых паттернов для работы с библиотекой React. Вся информация взяты из просторов Интернета. Некоторые паттерны, на мой взляд, являются противоречивыми и приведены только с ознакомительной целью.

Для примера взята кнопка switch которая последовательно реализуется с применением разных подходов и усложнением логики работы.

Примеры кода находятся в папке src\examples пронумерованны и предполагают последовательное ознакомление т.к. последующие примеры могут содержать предыдущие паттерны.

Create with create-react-app

To start:

npm install or yarn install

npm start or yarn start

Open http://localhost:3000 to view it in the browser.

React Patterns

  • Default component
  • Compound components
  • React context
  • Render Props
  • Props Collections
  • Prop Getters
  • State Initializers
  • State Reducers
  • Control Props
  • Provider Pattern
  • Higher Order Components

Bonuses

  • Reusable Styles
  • State Reducers (with change types)
  • Proxy component
  • Controlled Components (submit form)
  • Uncontrolled Components (submit form)

screenShot

Links:

Morty Proxy This is a proxified and sanitized view of the page, visit original site.