This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import { AppContainer } from 'react-hot-loader'; | |
| // AppContainer is a necessary wrapper component for HMR | |
| import App from './components/App'; | |
| const render = (Component) => { | |
| ReactDOM.render( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Radium, { StyleRoot } from 'radium'; | |
| import breakpoints from '../../../styles/breakpoints'; | |
| const styles = { | |
| header: { | |
| fontSize: '1.5em', | |
| display: 'inline', | |
| [`@media screen and (min-width: ${breakpoints.screenMedium})`]: { | |
| paddingTop: '2%'; | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import userStorage from '../shared/storage/user'; | |
| import history from '../history'; | |
| const connectAuthCheck = doCheckFn => (Comp) => { | |
| class AuthedComonent extends Component { | |
| state = { | |
| authed: false, | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {connect} from "react-redux"; | |
| import {action1, action2} from "myActions"; | |
| const MyComponent = (props) => ( | |
| <div> | |
| <button onClick={props.action1}>Do first action</button> | |
| <button onClick={props.action2}>Do second action</button> | |
| </div> | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 添加新东西 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { React, ReactDOM } from "https://unpkg.com/es-react@16" | |
| import htm from "https://unpkg.com/htm?module" | |
| const html = htm.bind(React.createElement) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function App() { | |
| const [todos, setTodos] = useState([ | |
| { id: 1, title: "Selectus aut autem", completed: false }, | |
| { id: 2, title: "Luis ut nam facilis et officia qui", completed: false }, | |
| { id: 3, title: "Fugiat veniam minus", completed: false }, | |
| { id: 4, title: "Aet porro tempora", completed: true }, | |
| { id: 5, title: "Laboriosam mollitia et enim quasi", completed: false } | |
| ]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const [value, setValue] = useState(0) |