Difference between revisions of "React"

From Wiki2
Line 20: Line 20:


==react-router==
==react-router==
with es6 classes mixins are not allowed  
===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
so mixins[Navigation] doesn't work


Line 34: Line 35:


  this.context.router.transitionTo('login')
  this.context.router.transitionTo('login')
===with React.creatClass({})===
    var Navigation = require('react-router').Navigation;
    ...
    var Yard = React.createClass({
    mixins: [Navigation],
    ...
    this.transitionTo('reg')

Revision as of 13:02, 28 September 2015


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

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({})

   var Navigation = require('react-router').Navigation;
   ...
   var Yard = React.createClass({
   	mixins: [Navigation],
   ...
   this.transitionTo('reg')