Fork me on GitHub
#fulcro
<
2020-02-13
>
daniel.spaniel17:02:05

Has anyone tried using the react-window package to help with scrolling large data sets. ? I could do pagination too, but was checking out this solution as well.

mdhaney18:02:15

I’m trying to integrate with the react-navigation library, and I need to create a static method on my component class. It works when I create a plain component with create-react-class and then use gobj/extend to add the static. But I can’t get it working when I use defsc. I know this was possible a long time ago with the defui macro, but how can I do it now with defsc?

currentoor19:02:31

as of react 3, adding extra functions to the config map just puts them under :fulcro$options key on both the instance and the class

currentoor19:02:48

whereas before you could actually decorate the class

currentoor19:02:00

what happens if you define a class with defsc then use gobj/extend to add a static method to it?

currentoor19:02:34

looks like that’s what defsc is doing internally anyway

mdhaney20:02:04

That’s exactly what I tried, but it didn’t appear to work. I’ll dig into it some more.

mdhaney00:02:24

So gobj/extend was working, but the error was elsewhere. This library is a real pain to integrate with, but I’m 2/3 of the way there. I have wrappers that work for their AppContainer and Navigators, now just have to get a wrapper working for individual screens, which is a challenge because their Navigator appears to be swallowing all the props I try to pass in. 😤

tony.kay00:02:28

You’ve read the book on the async function as a child pattern, right?

tony.kay00:02:37

the whole with-parent-context stuff?

mdhaney00:02:03

Yeah, several times. The problem is, it’s more like react-class as a child - it won’t let me pass in a function for individual screens. It wants the component class, and they are creating their own factory - so nowhere to intercept and sneak in props.

mdhaney00:02:57

Ah, but according to the docs, it looks like the Navigator can take a screenProps in its props - that’s probably the fix. Trying now.

tony.kay00:02:36

hm…yeah, another notch in the belt of “it would be nice if Fulcro components could act as standalone roots”

tony.kay00:02:29

hm…though in this case I’m not sure how it would know the parent context…

mdhaney04:02:03

Finally got it working! With a simple example, at least. Once I make it reusable and test it with my full app, I’ll add it to fulcro-native. This also paves the way for shared-element transitions, which build on top of react-navigation, so look for that feature next. 🙂