-
Notifications
You must be signed in to change notification settings - Fork 47.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overriding/extending ReactHostComponent.createInternalComponent #8358
Comments
We are working on reimplementation of React (you can search for "Fiber" in issues), so this particular internal API will definitely be removed, and project using it will break. Instead Fiber will eventually provide an official way to create custom renderers. Projects like Is there any particular reason you implement these as internal components instead of using React public API? It is not clear to me. |
Thank you for reviewing this, Dan. Great news that there will be an official way to create custom renderers! It would be nice to be able to extend or augment the built in html renderer rather than reimplementing rendering from scratch. React-art requires a specific root element as the context for rendering art element. I'd prefer to be able to render Ext JS and html components interchangeably, rather than manually switching contexts with a root element. I ask that you consider this use case when implementing the custom renderer API. I chose to use internal components rather than using the public API for a few reasons, but these are probably the most important:
That said, nothing is set in stone. We just published this package last week, so it's still fairly early. I'm certainly open to suggestions to improve and future-proof our implementation. Do you think using a higher order component to wrap Ext JS components would be a more sustainable solution? For example, user's code would look something like: import { reactify } from '@extjs/reactor';
const Grid = reactify('Ext.grid.Panel');
export default function MyComponent() {
return <Grid ... />
} |
Yes that would be a better solution in longer term I think. |
Going to close as it's not actionable for us right now, and seems like you have a way forward. |
@gaearon Do you have an estimate of when the fiber-based reimplementation of react will be released and what the version number will be? What's the best way for me to track your progress? Thank you for your help. Switching to a higher order component turned out to be a fairly simple change with little impact on my existing code. |
You can track the progress in #7925. I hope React 17 will use Fiber, we'll also likely provide it as opt-in in a few months. |
reactify doesn't work for me when I use override instead of extends in a Ext.define |
It would be nice to be able to override or extend ReactHostComponent.createInternalComponent to expand the set of elements that can be rendered beyond html. In extjs-reactor we are doing this by patching the createInternalComponent function so that any tag that starts with a specified prefix (the default is x-) creates an Ext JS Component: https://github.com/sencha/extjs-reactor/blob/master/packages/reactor/src/index.js#L14
I'd love to have a more stable way of doing this. It looks like something along these lines was originally considered, but never fully implemented and recently removed:
461a741
Do you have any advice for a more sustainable approach or would you consider an API for this?
The text was updated successfully, but these errors were encountered: