Fabric Components as Native Components
这个文档仍然是实验性的,随着我们的迭代,细节会有变化。欢迎在工作小组内的讨论中分享你的反馈。
此外,它还包含几个手动步骤。请注意新架构尚未稳定下来,最终的开发者体验会继续迭代改善。我们正在努力开发工具、模板和库,以帮助你在新架构上快速入门,而不需要经历整个设置过程。
The creation of a backward compatible Fabric Component requires the knowledge of how to create a Fabric Component. To recall these concepts, have a look at this guide.
Fabric Components only work when the New Architecture is properly setup. If you already have a library that you want to migrate to the New Architecture, have a look at the migration guide as well.
Creating a backward compatible Fabric Component lets your users continue leverage your library, independently from the architecture they use. The creation of such a component requires a few steps:
- Configure the library so that dependencies are prepared set up properly for both the Old and the New Architecture.
- Update the codebase so that the New Architecture types are not compiled when not available.
- Uniform the JavaScript API so that your user code won't need changes.
新架构对于 TypeScript 的支持尚处于 beta 测试阶段。
While the last step is the same for all the platforms, the first two steps are different for iOS and Android.