-
-
Notifications
You must be signed in to change notification settings - Fork 349
Wasted renders when using the <Observer> component? #423
Comments
I think it's a bug, because implementation seems completely wrong to me. |
Thank you @urugator |
Well, I think that a whole thing should be refactored into Observer being regular component (with render/children prop) in a first place and then turning it into HoC. It's kinda messy now and hard to track an actual issue. I might be able get to it, but no promises. If someone has more free time, feel free to do it. /cc @Sunshine168 |
Correct @urugator , this is indeed a bug, sorry for not noticing it earlier :) PR's are welcome (including tests). Otherwise I'll take a stab at it next week or so |
@FredyC eemm, it is regretful for marking this future incorrectly. const comp = Observer(inject)(component) i so busy during this period (orz) ,but if i can do this correctly , i will try |
This has me dead in the water with my React Native project, since use of FlatList requires the use of the Observer component. |
@duro Observer is fine, just don't use the |
|
@mweststrate Well, I would love to see some example what do you mean. Sure, the inject is redundant and can be easily replaced with React Context API, but I cannot imagine what is the alternative to |
Sorry for the confusion, Observer will stay, it just won't support that
`inject` property anymore in the future
Op di 24 apr. 2018 om 09:26 schreef Daniel K. <[email protected]>:
… @mweststrate <https://github.com/mweststrate> Well, I would love to see
some example what do you mean. Sure, the inject is redundant and can be
easily replaced with React Context API
<#448>, but I cannot imagine
what is the alternative to Observer?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#423 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhPJmVgY2khazyTPLL6wYtcIToX0Vks5trtOKgaJpZM4SGHuE>
.
|
Hello,
I have a simple functional component where I'm using the
<Observer/>
component:This component is always being re-rendered.
Here is a working example on codesandbox
In the same link I've created a similar stateless component that doesn't get re-rendered every single time:
Is this a bug or I'm I missing something?
Thanks in advance
The text was updated successfully, but these errors were encountered: