Skip to content
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

ES5 Class components section still references the removed createClass API #175

Open
p1100i opened this issue Feb 18, 2025 · 2 comments
Open

Comments

@p1100i
Copy link

p1100i commented Feb 18, 2025

The components subpage has still a section about creating class components using the removed createClass API. I think that's not possible anymore.

I'm a weird dude, and doing still everything in ES5. I read in the changelog that I should be using createComponentVNode, but I'm a bit lost on that API. So, if instead of just removing the outdated section, a rewrite would happen, that would be lovely.

@Havunen
Copy link
Member

Havunen commented Feb 19, 2025

You can see the whole implementation of create-class here: https://www.npmjs.com/package/inferno-create-class?activeTab=code

It basically called "bind" on all the methods of a given function. It is better practice to bind only the methods used as callbacks.

@p1100i
Copy link
Author

p1100i commented Feb 19, 2025

Sorry, I might've misformulated my issue. My point is that the 9.0.0 release notes contains that:

inferno-create-class has been removed, use createComponentVNode, createElement APIs instead.

And the current 9.x+ inferno website components page still contains a section (bottom of the page) which references the use of the createClass method with a broken link.

My understanding is that, if I want to use inferno v9+, I need to either use createComponentVNode or createElement to implement the same functionality, which was provided by createClass. I was looking for such an example, instead of the section containing the broken link.

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

No branches or pull requests

2 participants