diff --git a/examples/Javascript Examples/React.md b/examples/Javascript Examples/React.md deleted file mode 100644 index 7b2b203ea..000000000 --- a/examples/Javascript Examples/React.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -related: - cheat-sheet: [ 'React PropTypes' ] ---- - -## Minimal application - - import React from 'react' - import ReactDOM from 'react-dom' - - ReactDOM.render(
Test
, document.getElementById('content')); - -## Writing React.js Components - -### Writing a stateless React component - -Just return some static HTML - - const MyComponent = () => { - return
some HTML
- } - -If you want to have parameters - - const MyComponent = (param) => { - return
some {param.name}
- } - -Using a stateless component - - React.DOM.render(, document.getElementById('content')) - -## Real component with full lifecycle - - class MyApp extends React.Component { - constructor(props) { - super(propes); - // init... - } - - render() { - return ( -
Stuff
- ) - } - - // now all lifecycle callbacks - componentWillMount() {} - componentDidMount() {} - componentWillUnmount() {} - - componentWillReceiveProps() {} - componentDidReceiveProps() {} - - shouldComponentUpdate() {} - - componentWillUpdate() {} - componentDidUpdate() {} -}