Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
This repository was 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

Description

@catmando

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @catmando

        Issue actions

          clean up how ruby component classes are translated to react component classes · Issue #270 · ruby-hyperloop/hyper-react