Fork me on GitHub

hey @mauricio.szabo, this is a fine place to ask.


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


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.