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

Implement support for Inferno.memo ( React.memo ) #1443

Open
Havunen opened this issue Feb 8, 2019 · 9 comments
Open

Implement support for Inferno.memo ( React.memo ) #1443

Havunen opened this issue Feb 8, 2019 · 9 comments

Comments

@Havunen
Copy link
Member

Havunen commented Feb 8, 2019

Implement support for React.memo

Consider drop support for functional component hooks onComponent -API becomes useless after implementing this.

https://reactjs.org/blog/2018/10/23/react-v-16-6.html#reactmemo

@springuper
Copy link
Contributor

great to learn Inferno is going to support it, could you share an estimated date if possible?

@ChrisKuBa
Copy link
Contributor

Why will be all onComponent -API s becomes useless? React.memo replaces onComponentShouldUpdate but not the other hooks!?!

@Havunen
Copy link
Member Author

Havunen commented Mar 7, 2019

@chrkulbe Nothing is decided, there was discussion in Slack about dropping them. I recently did trial with this and we could maybe just add this functionality without any breaking changes

@tamb
Copy link

tamb commented Apr 29, 2020

Maybe an inferno supported library for this? Keep the core light.

@PorterK
Copy link

PorterK commented Jun 25, 2020

Hey @Havunen are there any updates on this?

@Havunen
Copy link
Member Author

Havunen commented Jun 26, 2020

No, I have not had time to work on this. I personally have no need for this functionality so its pretty low on my todo list. Would you like to work on this? As suggested by @tamb it would make sense to have this as separate opt-in module.

@PorterK
Copy link

PorterK commented Jun 29, 2020

No, I have not had time to work on this. I personally have no need for this functionality so its pretty low on my todo list. Would you like to work on this? As suggested by @tamb it would make sense to have this as separate opt-in module.

Yeah, I can give it a go! Would like to use inferno on a project but we use MUI, so memo support is necessary (according to #1510) I wont have time to grab this until early next week

Thanks

@marvinhagemeister
Copy link
Collaborator

@PorterK FYI: Our implementation in Preact might be of interested as a starting point:

https://github.com/preactjs/preact/blob/8825bf1ca2e4b5957556d9c6d385feceeffc242f/compat/src/memo.js#L11-L34

@Havunen
Copy link
Member Author

Havunen commented Jun 30, 2020

Hmm, we could try out if Preact approach works for us? In infernojs we can add SCU hook on functional component too using onComponentShouldUpdate that might be good fit for this feature

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

No branches or pull requests

6 participants