/
githubmirror
/
redux
Обзор
Документация
Войти
/
githubmirror
/
redux
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/universal/common/components/Counter.js
27 строк
693 B
Tim Dorr
Format the examples
20 мар 2024, 19:52
Не верифицирован
20 мар 2024, 19:52
3085048
Код
Авторство
О чём код?
import React from 'react' import PropTypes from 'prop-types' const Counter = ({ increment, incrementIfOdd, incrementAsync, decrement, counter }) => ( <p> Clicked: {counter} times <button onClick={increment}>+</button>{' '} <button onClick={decrement}>-</button>{' '} <button onClick={incrementIfOdd}>Increment if odd</button>{' '} <button onClick={() => incrementAsync()}>Increment async</button> </p> ) Counter.propTypes = { increment: PropTypes.func.isRequired, incrementIfOdd: PropTypes.func.isRequired, incrementAsync: PropTypes.func.isRequired, decrement: PropTypes.func.isRequired, counter: PropTypes.number.isRequired } export default Counter