fable-lit-fullstack-template icon indicating copy to clipboard operation
fable-lit-fullstack-template copied to clipboard

Integrating with Feliz

Open leolorenzoluis opened this issue 2 years ago • 4 comments

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.

leolorenzoluis avatar Feb 10 '23 00:02 leolorenzoluis

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?

JordanMarr avatar Feb 10 '23 08:02 JordanMarr

@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

leolorenzoluis avatar Feb 10 '23 23:02 leolorenzoluis

Which React control are you trying to use?

JordanMarr avatar Feb 11 '23 01:02 JordanMarr

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).

leolorenzoluis avatar Feb 11 '23 04:02 leolorenzoluis