You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After playing around with proc I came up with an idea.
I'm after interacting with a native module without going through the bridge (who isn't??).
This is mainly the goal of Animated and especially of reanimated and is thereact-native turn off.
So now that proc is live I'm thinking of something as follows:
The procs passed as args will be in charge of consuming the callback args (onSuccess/onFailure?) that every ReactMethod has. The only thing I'm thinking of are ReadableMaps that are passed back to the callback - I'm guessing there could be an option to reuse event for this purpose.
This approach is valid for dispatchViewManagerCommand as well.
It unlocks endless options (e.g. native state management), complements createAnimatedComponent and sounds to me pretty revolutionary.
A simple use case:
A touch event has started.
I need the absolute layout of a view for some animation calculation.
I need to call UIManager.measure and then set values.
This is a major bottle neck to the UI.
Another use case:
I need to get a value returned for a native module method during a pan gesture event (e.g. if touches are hitting an SVG path)
I'm calling the method from js, so it seems unresponsive.
Ultimate use case:
let's say I'm dragging a view in a ScrollView and want to scroll. With NativeMethodProc I can simply add the proc to my block and scroll freely while panning.
The text was updated successfully, but these errors were encountered:
After playing around with
proc
I came up with an idea.I'm after interacting with a native module without going through the bridge (who isn't??).
This is mainly the goal of
Animated
and especially ofreanimated
and is thereact-native
turn off.So now that
proc
is live I'm thinking of something as follows:The procs passed as args will be in charge of consuming the
callback
args (onSuccess/onFailure?) that everyReactMethod
has. The only thing I'm thinking of areReadableMaps
that are passed back to thecallback
- I'm guessing there could be an option to reuseevent
for this purpose.This approach is valid for
dispatchViewManagerCommand
as well.It unlocks endless options (e.g. native state management), complements
createAnimatedComponent
and sounds to me pretty revolutionary.A simple use case:
A touch event has started.
I need the absolute layout of a view for some animation calculation.
I need to call
UIManager.measure
and then set values.This is a major bottle neck to the UI.
Another use case:
I need to get a value returned for a native module method during a pan gesture event (e.g. if touches are hitting an SVG path)
I'm calling the method from js, so it seems unresponsive.
Ultimate use case:
let's say I'm dragging a view in a
ScrollView
and want to scroll. WithNativeMethodProc
I can simply add the proc to myblock
and scroll freely while panning.The text was updated successfully, but these errors were encountered: