mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Introduce general API for setting C++ State from the View layer and getting a notification if it fails, with Android impl
Summary: iOS will need to be implemented separately, but the shared C++ bits are in place. Explanation: there is currently no way for the View layer to /know/ if an UpdateState call has succeeded or failed. Generally we just assume it succeeds, but if it fails we have no way of knowing or retrying. This can cause some UI bugs. To mitigate this, I'm introducing a "failure" notification callback mechanism. The JNI bridging for this is a little complicated to avoid passing Runnable across the JNI, but it should be much simpler on iOS. In development this seems to make View components much more reliable. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D22940187 fbshipit-source-id: 917f2932ae22d421f91fe8f4fca3f07dc089f820
This commit is contained in:
1 parent
b6ba6f5808
commit
774dec1e17
12 files changed
+197
-175
No files matched your search
@@ -23,4 +23,10 @@ public interface StateWrapper {
|
||||
|
||||
/** Pass a map of values back to the C++ layer. */
|
||||
void updateState(WritableMap map);
|
||||
|
||||
/**
|
||||
* Pass a map of values back to the C++ layer. /Last/ runnable passed into updateState is called
|
||||
* if an updateState call fails.
|
||||
*/
|
||||
void updateState(WritableMap map, Runnable failureCallback);
|
||||
}
|
||||
Reference in new issue
Block a user