infernojs / inferno

:fire: An extremely fast, React-like JavaScript library for building modern user interfaces
https://infernojs.org
MIT License
16.1k stars 635 forks source link

[Question] Inferno renders a component incorrectly #1625

Closed farooqkz closed 1 year ago

farooqkz commented 1 year ago

Hello. I think I'm overlooking something so I thought you could help me with this.

I have a RoomView component which renders just fine: https://github.com/farooqkz/chooj/blob/main/src/RoomView/RoomView.js#L319

Unless I use this MembershipEvent component as what RoomEvent(used in RoomView) returns which is later a child of RoomView's div

https://github.com/farooqkz/chooj/blob/main/src/RoomView/RoomEvent.js#L15

I've also tried rendering something else instead of what MembershipEvent renders now but same result.

Havunen commented 1 year ago

Can you clarify what is the expected result there? What are you trying to accomplish?

I quickly checked through the code you rereferred here and it seems there is some filtering and mapping in RoomView.js render method. You could try adding key prop to your RoomEvent / ScrollIntoView, the key should stay the same when you are expecting the component to update instead of unmount / re-mount.

farooqkz commented 1 year ago

I am trying to have a list of RoomEvents in there but when I render MembershipEvent, upon mounting RoomView I have my TabView component in its place. See the attachment bug

farooqkz commented 1 year ago

bump

Havunen commented 1 year ago

How do you debug that repository without kaiOs device?

farooqkz commented 1 year ago

How do you debug that repository without kaiOs device?

The screencast is from a KaiOS device.

Havunen commented 1 year ago

Yeah I understand that, but I believe there is some simple mistake in the application code, but as I'm unfamiliar with the code base and I don't know what the application is supposed to do, its difficult for me to give you hint how to fix the issue. I dont have access to KaiOS device

farooqkz commented 1 year ago

Yeah I understand that, but I believe there is some simple mistake in the application code, but as I'm unfamiliar with the code base and I don't know what the application is supposed to do, its difficult for me to give you hint how to fix the issue. I dont have access to KaiOS device

Ah okay thank you anyway.