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 {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
| 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 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 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( |
-
Actually React also can render null, it's better to use null rather than empty string '', as you can see in here: Correct way to define an empty dom element in React.
-
https://medium.com/@linmic/theming-system-in-react-js-way-99604025c91a
refer: https://java.libhunt.com/project/wiremock/vs/moco
- wiremock usage:
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
| /** @jsx React.DOM */ | |
| var React = require('react'); | |
| var Logo = require('../atoms/logo'); | |
| var PrimaryNav = require('../molecules/primary-nav'); | |
| var Search = require('../molecules/search'); | |
| var OrganismsHeader = React.createClass({ | |
| render: function () { | |
| return | |
| <header> | |
| <Logo/> |