ruby-hyperloop / hyper-react

The project has moved to Hyperstack!!
https://hyperstack.org/
MIT License
285 stars 14 forks source link

Difference with ReactJS #183

Closed zetachang closed 6 years ago

zetachang commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

janbiedermann commented 6 years ago

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.