/
suhushinas
/
renderless-components-examples
Обзор
Документация
Войти
/
suhushinas
/
renderless-components-examples
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/modules/example-map/components/GeoJSONField.jsx
32 строки
638 B
SuhushinAS
fix
23 апр 2019, 17:39
23 апр 2019, 17:39
c9b81bd
Код
Авторство
О чём код?
import 'modules/example-map/components/GeoJSONField.css'; import React from 'react'; class GeoJSONField extends React.Component { static defaultProps = { onChange: () => { }, value: {}, }; render() { const {id, value} = this.props; return ( <div className="geo-json"> <input id={id} name="tile" onChange={this.handleChange} defaultChecked={value[id]} type="checkbox" /> <label htmlFor={id}>{id}</label> </div> ); } handleChange = () => { this.props.onChange(this.props.id); }; } export default GeoJSONField;