Thanks! I was wondering if someone had experiences with @testing-library/react-native and freerange. If I render the component with provide-frame, the rendered component does not get the latest frame. Worse yet, bind-frame does work but it's synchronous, so I can't test async info with freerange because the moment an event/context comes back, the frame is already gone... any tips?
Also, after creating the frame with make-frame, I'm registering the built-in effects and coeffects with register-built-in! calls. Do I have to cleanup them after each testcase?
@mauricio.szabo can you hang on to the frame in a lexical scope?
and use it in an event handler
I kinda can, but I'm adding freerange on a codebase that already have react with a different framework, and I kinda don't want to mess up with the code outside the Clojure world...
for what is worth, I could not make it work against code (even when adding :context-type to the actual component. Using the freerange context/frame api seems strictly required.
bumped into this when trying to use freerange - I was actually wondering if I can use it for existing components basically
I can actually see the frame when I use context/defc but cannot figure out how to apply the metadata to an existing component without changing its declaration
(I am testing this from a Storybook story but the same would apply to devcards or even just a unit test)
not following completely. I don’t think there’s a way of avoiding passing the frame to the event handlers.
like where you call re-frame/dispatch
Well, I was using re-frame.context as the way to dispatch/subscribe things, and I was getting the frame implicitly by rendering my reagent component with [re-frame.context/provide-frame [my-reagent-component ...]]
I'm not sure if this is the right way to do it...
yes that's right but you need to handle event handlers differently since they don't have access to the frame provided via react context anymore unfortunately.
hey @mauricio.szabo, this is a fine place to ask.