Install the scoped package, then let the package exports map resolve the web or native entrypoint automatically.
- Web peers:
reactandreact-dom - Native peers:
react-native - In React Native TypeScript projects, add
"customConditions": ["react-native"]so the IDE picks the native type surface - Some field renderers can rely on extra ecosystem packages in your app, such as phone or file-picker helpers, but the form API itself stays the same.
terminalbash
| 1 | npm install @runilib/react-formbridge |
| 2 | # or |
| 3 | yarn add @runilib/react-formbridge |
| 4 | # or |
| 5 | pnpm add @runilib/react-formbridge |
React Native TypeScript note
If your editor still shows web-only props in a React Native app, make sure TypeScript resolves the react-native export condition.
InlineExample-1.jsonjson
| 1 | { |
| 2 | "compilerOptions": { |
| 3 | "customConditions": ["react-native"] |
| 4 | } |
| 5 | } |