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

clean up how ruby component classes are translated to react component classes #270

Open
catmando opened this issue Jul 19, 2018 · 0 comments

Comments

@catmando
Copy link
Contributor

Currently, the first time a ruby component class is passed to createElement, a wrapper react.js component class is created (see react/api.rb)

The lifecycle methods in the wrapper class then call back into the ruby class.

This is not only inefficient but in the case of componentDidCatch it doesn't work, since this means every component class is defined with a componentDidCatch method, where as react assumes only components that will handle an error boundry will have a componentDidCatch method.

So what should happen is that as soon as a the hyperloop component mixin is included in a class, this immediately creates a new react prototype class. Then as each life cycle method is called for the first time, the appropriate hook is added to the prototype class.

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

No branches or pull requests

1 participant