mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add support for UnsafeObject to allow using Flow strict in native modules
Summary: This new type will be valid in Flow strict mode and can be used by native modules and components to replace `Object`, with the same semantics. This unblocks the migration of the most modules in the React Native package to Flow strict. Changelog: [Internal] Add UnsafeObject type compatible with Flow strict mode to use in native modules and components Reviewed By: RSNara Differential Revision: D25540631 fbshipit-source-id: 60b80bbc84a53aecc747e3a1799cdf551e1859cd
This commit is contained in:
committed by
Facebook GitHub Bot
parent
89beefaefb
commit
e088a4fe9c
@@ -109,6 +109,16 @@ public class SampleTurboModule extends NativeSampleTurboModuleSpec {
|
||||
return map;
|
||||
}
|
||||
|
||||
@DoNotStrip
|
||||
@Override
|
||||
@SuppressWarnings("unused")
|
||||
public WritableMap getUnsafeObject(ReadableMap arg) {
|
||||
WritableNativeMap map = new WritableNativeMap();
|
||||
map.merge(arg);
|
||||
log("getUnsafeObject", arg, map);
|
||||
return map;
|
||||
}
|
||||
|
||||
@DoNotStrip
|
||||
@SuppressWarnings("unused")
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user