JordanMarr / fable-lit-fullstack-template

A SAFE-style template with Fable.Lit, Fable.Remoting and Giraffe
MIT License
58 stars 1 forks source link

Integrating with Feliz #15

Open leolorenzoluis opened 1 year ago

leolorenzoluis commented 1 year ago

Hi,

It's me again. Sorry if I keep asking a lot of questions as I'm learning too, but do you know how to integrate Lit with React properly? I am aware of the Lit.React.toLit binding but I can't grok how to manage the lifecycles between the two.

JordanMarr commented 1 year ago

Though i have developed apps with Feliz and Fable.Lit, I have never tried to share components between them. But I am very interested to see how this would work.

Is there an example of how to use this posted somewhere?

leolorenzoluis commented 1 year ago

@JordanMarr https://github.com/fable-compiler/Fable.Lit/blob/main/sample/App.fs#L31 I am trying but it looks like I'm getting bug when hooking it up with the lifecycle of react using the toLit that was provided. I'm not sure if I should pursue this path as Alfonso mentioned that he's not sure if it has performance issues. See https://github.com/fable-compiler/Fable.Lit/discussions/61

JordanMarr commented 1 year ago

Which React control are you trying to use?

leolorenzoluis commented 1 year ago

Just a custom one with react-transition-group. I conclude mixing Lit and React doesn't play nice with its own lifecycles. :) I figure out the bugs. The props can updated, but within that library it wants the change notification within react (react-transition-group library).