Difference between revisions of "React"
(→React) |
|||
(17 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=React= | |||
https://beta.reactjs.org/learn/you-might-not-need-an-effect?ck_subscriber_id=887777172 | |||
==react router 6 == | |||
https://morioh.com/p/b3674d897ebe | |||
==old react == | |||
React UI only rerenders whenever you call setState() or ReactDOM.render().The props need to come from state as in ' {El3(this.state.el3)}` or `<Welcom name={this.state.we.name}/>` or they won't rerender on a change of state. | |||
===see also=== | |||
[[Reactive_functional_programming]] | |||
{{:redux}} | |||
[http://reactjsnewsletter.com/ react newsletter] | |||
https://mail.google.com/mail/u/0/#inbox/14fb843aaad89ffe | |||
http://react.rocks/tag/WebSockets | http://react.rocks/tag/WebSockets | ||
Line 14: | Line 33: | ||
http://javascript.tutorialhorizon.com/2015/06/06/using-context-and-childcontext-in-react/ | http://javascript.tutorialhorizon.com/2015/06/06/using-context-and-childcontext-in-react/ | ||
==react-router== | |||
https://scotch.io/tutorials/routing-react-apps-the-complete-guide?utm_source=javascriptweekly&utm_medium=email | |||
as of 1.0.0-rc1 9/28/15 | |||
===with es6 classes mixins are not allowed=== | |||
:see http://10.0.1.150/react/sb/cascada-webpack/app/components/Signup.js | |||
so mixins[Navigation] doesn't work | |||
after you define the class and before you export add an object called contextTypes with a key of router like so | |||
Signup.contextTypes = { | |||
router: React.PropTypes.func.isRequired | |||
}; | |||
module.exports = Signup; | |||
then you can use transitionTo like so: | |||
this.context.router.transitionTo('login') | |||
===with React.creatClass({})=== | |||
:see http://10.0.1.150/react/sb/cascada-webpack/app/components/Yard.js | |||
var Navigation = require('react-router').Navigation; | |||
... | |||
var Yard = React.createClass({ | |||
mixins: [Navigation], | |||
... | |||
this.transitionTo('reg') |
Latest revision as of 12:43, 30 June 2022
React
https://beta.reactjs.org/learn/you-might-not-need-an-effect?ck_subscriber_id=887777172
react router 6
https://morioh.com/p/b3674d897ebe
old react
React UI only rerenders whenever you call setState() or ReactDOM.render().The props need to come from state as in ' {El3(this.state.el3)}` or `<Welcom name={this.state.we.name}/>` or they won't rerender on a change of state.
see also
Reactive_functional_programming
redux
http://teropa.info/blog/2015/09/10/full-stack-redux-tutorial.html
https://mail.google.com/mail/u/0/#inbox/14fb843aaad89ffe
http://react.rocks/tag/WebSockets
https://github.com/gritzko/todomvc-swarm
https://github.com/kriasoft/react-starter-kit
http://tylermcginnis.com/reactjs-tutorial-pt-2-building-react-applications-with-gulp-and-browserify/
https://facebook.github.io/react/docs/forms.html
https://facebook.github.io/react/docs/interactivity-and-dynamic-uis.html
http://react-bootstrap.github.io/components.html#input
http://javascript.tutorialhorizon.com/2015/06/06/using-context-and-childcontext-in-react/
react-router
https://scotch.io/tutorials/routing-react-apps-the-complete-guide?utm_source=javascriptweekly&utm_medium=email as of 1.0.0-rc1 9/28/15
with es6 classes mixins are not allowed
so mixins[Navigation] doesn't work
after you define the class and before you export add an object called contextTypes with a key of router like so
Signup.contextTypes = { router: React.PropTypes.func.isRequired };
module.exports = Signup;
then you can use transitionTo like so:
this.context.router.transitionTo('login')
with React.creatClass({})
var Navigation = require('react-router').Navigation; ... var Yard = React.createClass({ mixins: [Navigation], ... this.transitionTo('reg')