I have an optional dependency defined in package.json:
"optionalDependencies": {
"optional-react-native-module": "1.0.0"
}
Despite it being installed into /node_modules, react-native config does not output this dependency configuration.
When defining the optional dependency in package.json's dependencies block, it does get autolinked.
Is there a way to autolink optional dependencies?
A potential workaround is to specify the optional dependency in dependencies as well.
You need to add this lib as your project dependency as well, no other way at the moment. Here's an issue tracking how we can make it better: https://github.com/react-native-community/cli/issues/870
Most helpful comment
You need to add this lib as your project dependency as well, no other way at the moment. Here's an issue tracking how we can make it better: https://github.com/react-native-community/cli/issues/870