Add Metro configuration to resolve native-only React Native APIs with web-compatible shims. This enables packages like react-native-pager-view to work on the web platform by providing shim implementations for codegenNativeComponent, codegenNativeCommands, and CodegenTypes that are unavailable in react-native-web. Also simplify Android signing configuration in CI by using standard Gradle property names (MYAPP_UPLOAD_*) and remove the build.gradle patching step.
15 lines
439 B
JavaScript
15 lines
439 B
JavaScript
function codegenNativeCommands(options) {
|
|
const commands = {};
|
|
if (options && options.supportedCommands) {
|
|
options.supportedCommands.forEach((commandName) => {
|
|
commands[commandName] = (ref, ...args) => {
|
|
if (ref && ref.current && typeof ref.current[commandName] === 'function') {
|
|
ref.current[commandName](...args);
|
|
}
|
|
};
|
|
});
|
|
}
|
|
return commands;
|
|
}
|
|
|
|
module.exports = codegenNativeCommands; |