[0.75] Add support for handling com.facebook.react.bridge.Dynamic as parameter for TurboModules (#46066)

This commit is contained in:
Nicola Corti
2024-08-19 14:18:40 +01:00
committed by GitHub
parent b5b57731d3
commit 45cd81706d
8 changed files with 216 additions and 6 deletions
@@ -142,6 +142,17 @@ class SampleLegacyModuleExample extends React.Component<{||}, State> {
getSampleLegacyModule()?.getObject({a: 1, b: 'foo', c: null}),
getValue: () =>
getSampleLegacyModule()?.getValue(5, 'test', {a: 1, b: 'foo'}),
getDynamicWithNull: () => getSampleLegacyModule()?.getDynamic(null),
getDynamicWithBoolean: () =>
getSampleLegacyModule()?.getDynamic(true),
getDynamicWithNumber: () =>
getSampleLegacyModule()?.getDynamic(42.24),
getDynamicWithString: () =>
getSampleLegacyModule()?.getDynamic('The answer is 42'),
getDynamicWithArray: () =>
getSampleLegacyModule()?.getDynamic(['the', 'answer', 'is', '42']),
getDynamicWithMap: () =>
getSampleLegacyModule()?.getDynamic({answer: '42'}),
callback: () =>
getSampleLegacyModule()?.getValueWithCallback(callbackValue =>
this._setResult('callback', callbackValue),