Cli: Unable to autolink optionalDependencies

Created on 2 Dec 2019  路  1Comment  路  Source: react-native-community/cli

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.

question

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

>All comments

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

Was this page helpful?
0 / 5 - 0 ratings