You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.
Previously , react-source gem v0.12.0 is only used as development dependency. Since the changes introduced will break in version under 0.13, so we will explicitly depends on react-source.
Also, you can now include the react source simply by adding a line as below without manually download or manage the source.
<%= javascript_include_tag 'react.js' %>
Toll-free bridge React::Component
We are introducing toll-free bridge React::Component.
Previously, the Ruby instance created through React.render(Foo) is actually not the component instance created by React.js framework. The Ruby instance is created during first mount and cached inside the actual component instance as a property.
Upgrading
All the DSL you got by include React::Component remains almost the same. Only difference is that previously the native ReactComponent will be passed as the first argument in the initializer of your class. But since the instance is actually the real ReactComponent instance. So simply refer to self in your initializer if you want to do stuff with it.
Other breaking changes
props are immutable now, so set_props & set_props! are deprecated, see official blog post for upgrading details.
set_state! are deprecated (since replaceState is deprecated , see original issue for more details)
dom_node is deprecated in favor of React.find_dom_node
React.find_dom_node return a plain DOM object rather than a Native
I will move all the details to wiki when this is actually done, and feel free to leave a comment if there is any concern or clarification needed. 😉
From @zetachang on April 12, 2015 9:31
React.js v0.13 is released last month (http://facebook.github.io/react/blog/2015/03/10/react-v0.13.html).
Some work need to be done in react.rb to catch up this release, there is zetachang/react.rb#17 which tracks all the changes introduced.
Depends on
react-source
Previously , react-source gem v0.12.0 is only used as development dependency. Since the changes introduced will break in version under 0.13, so we will explicitly depends on
react-source
.Also, you can now include the react source simply by adding a line as below without manually download or manage the source.
Toll-free bridge React::Component
We are introducing toll-free bridge
React::Component
.Previously, the Ruby instance created through
React.render(Foo)
is actually not the component instance created by React.js framework. The Ruby instance is created during first mount and cached inside the actual component instance as a property.Upgrading
All the DSL you got by include
React::Component
remains almost the same. Only difference is that previously the native ReactComponent will be passed as the first argument in the initializer of your class. But since the instance is actually the real ReactComponent instance. So simply refer toself
in your initializer if you want to do stuff with it.Other breaking changes
set_props
&set_props!
are deprecated, see official blog post for upgrading details.set_state!
are deprecated (sincereplaceState
is deprecated , see original issue for more details)dom_node
is deprecated in favor ofReact.find_dom_node
React.find_dom_node
return a plain DOM object rather than a NativeI will move all the details to wiki when this is actually done, and feel free to leave a comment if there is any concern or clarification needed. 😉
Copied from original issue: zetachang/react.rb#19
The text was updated successfully, but these errors were encountered: