Skip to content

Instantly share code, notes, and snippets.

@alexandervantrijffel
Last active June 30, 2016 07:35
Show Gist options
  • Save alexandervantrijffel/6ff22bb4590279a1f84f40ab5ff2359e to your computer and use it in GitHub Desktop.
Save alexandervantrijffel/6ff22bb4590279a1f84f40ab5ff2359e to your computer and use it in GitHub Desktop.

className
htmlFor
http://blog.andrewray.me/flux-for-stupid-people/ http://blog.andrewray.me/webpack-when-to-use-and-why/ events: https://facebook.github.io/react/docs/events.html
typescript and react: http://blog.wolksoftware.com/working-with-react-and-typescript
react and redux with typescript: http://jaysoo.ca/2015/09/26/typed-react-and-redux/
typescript with react and webpack: https://www.typescriptlang.org/docs/handbook/react-&-webpack.html
http://blog.mgechev.com/2015/07/05/using-jsx-react-with-typescript/
https://medium.com/@fay_jai/getting-started-with-reactjs-typescript-and-webpack-95dcaa0ed33c#.5ro29rc8j
https://github.com/reactjs/redux http://blog.andrewray.me/reactjs-for-stupid-people/ https://www.npmjs.com/package/react-server-example https://github.com/es-shims/es5-shim

always wrap JSX in one HTML element:

  return (
     <div>
       <MyComponent1/>
         {canSwitch ? "yes" : "no"}
       <MyComponent2/>
     </div>
  )
onClick={this.props.clickHandler}
<ChildComponent clickHandler={this.performMagic} />

getInitialState: function() {
  return {
    clicks: 0
  };
}

this.setState({
  // Notice how we access the current state here
  clicks: this.state.clicks + 1
})

list of components
var items = [];
items.push(
	<li><MyComponent aproperty="123" /></li>
)

return (
  <ul>{items}</ul>
);

var MessageComponent = React.createClass( { 
	render: function () {
		return ( 
			<div>MyDiv {this.props.message}</div>
		);
	}
})
ReactDOM.render(
	<MessageComponent message="Hi" />,
	document.body
)


var MyComponent = React.createClass( { 
  render: function () { 
    return (
		
      );
  }
});

ReactDOM.render(
  <BoardSwitcher numBoards={3} />,
  document.getElementById('container')
);

http://buildwithreact.com/tutorial
http://andrewhfarmer.com/getting-started-tutorials/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment