Skip to content

injectComponentClasses won't work for ReactHostComponent #13

Description

@snowmantw

I try to extend my own renderer and found the code in React codebase:

https://github.com/facebook/react/blob/20bcabb1ea4cf492ade240bd6915b4bd44f04895/src/renderers/shared/stack/reconciler/ReactHostComponent.js#L18

actually won't use costumed registry for component mapping.

Such implementation has been changed: now they use the generic component to dispatch to the correct one. The latest commit and file still uses the pattern is:

https://github.com/facebook/react/pull/4030/files#diff-2d144b75481a75f394d00eedc6005297L112

In the current version, it has become things like this:

https://github.com/facebook/react/blob/30aa84181d98dc9498f7e1eb3ded817d8faf65f6/src/renderers/dom/shared/ReactDOMComponent.js#L537

Concluded by that, I changed my implementation to dispatch to the corresponding constructor via the generic one. So maybe the comment should be changed as well.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions