Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Difference with ReactJS #183

Closed
zetachang opened this issue Nov 8, 2016 · 3 comments
Closed

Difference with ReactJS #183

zetachang opened this issue Nov 8, 2016 · 3 comments

Comments

@zetachang
Copy link
Member

We currently implement some features which are different with ReactJS. They are

  1. self.state updated immediately after setting it even without the render to be finished.
  2. shouldComponentUpdate is handled by doing either shallow or deep compare on state & props.

I am thinking about at least write a document (e.g. Differences to ReactJS) on this topic given that there are users who already be familiar with reactjs.

@catmando is there something we do significantly different from reactjs I missed here ?

/cc @barriehadfield

@illogikal
Copy link

I think a good way to go about this would be to implement a small isomorphic app(without the rails integration, components only) side by side with a vanilla react app. Best way to learn code is to look at code IMO :)

@catmando
Copy link
Contributor

catmando commented Mar 7, 2017

FYI #178 makes the behavior follow react.
shouldComponentUpdate is a deeper discussion.

@janbiedermann
Copy link
Contributor

state handling is like in react now since lap20
should_component_update? does a opal ruby comparision next != current for state and props,
People complained about it not working, now, with above change, there are no more complains so far.
I think from the ruby developers point of view, when passing ruby objects as params or to state, its expected, when comparing them, that they compare like ruby objects, not like some obscure js shallow whatever that cant handle ruby objects.
Thats why i close this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants