【问题标题】:How to auto link assets after `yarn install` in React Native 0.60如何在 React Native 0.60 中的“纱线安装”后自动链接资产
【发布时间】:2020-01-05 20:18:24
【问题描述】:

所以我有我的自定义库my-library,带有一个react-native.config.js 文件。

module.exports = {
  dependency: {
    assets: ['Fonts'],    // This lib contains custom fonts.
  }
};

当我在不同项目的某处执行yarn install my-library 时,我需要手动运行react-native link my-library 以使字体在我的应用程序中可用。

是否可以在yarn install 上自动链接?

【问题讨论】:

    标签: react-native autolink


    【解决方案1】:

    阅读此https://facebook.github.io/react-native/blog/2019/07/03/version-60#native-modules-are-now-autolinked

    在大多数情况下,您不再需要运行 react-native link

    【讨论】:

      猜你喜欢
      • 2020-09-14
      • 2020-06-18
      • 2020-11-03
      • 2019-11-18
      • 2020-09-11
      • 2020-06-08
      • 2022-01-21
      • 2017-07-19
      • 2019-08-05
      相关资源
      最近更新 更多