1

I'm building a react-Native app with Expo, so I tried to use the components from the bootstrap library. I created a new project:

expo init test-app

then I installed the library in the project folder:

expo install react-bootstrap@next [email protected]

and I get this output with some unrelated warnings:

Installing 2 other packages using npm.

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 24 packages from 48 contributors and audited 1045 packages in 9.112s

29 packages are looking for funding run npm fund for details

found 8 vulnerabilities (6 low, 2 moderate) run npm audit fix to fix them, or npm audit for details

I import the component

import Button from 'react-bootstrap/Button';

but when I compile, the following message is shown: Screenshot of the expo panel,

Unable to resolve module react/jsx-runtime from C:\Users\Daniele\Documents\Coding\RipassoReact\test-app\node_modules\react-bootstrap\cjs\Button.js: react/jsx-runtime could not be found within the project.

I tried so many ways including wiping the node_modules folder and reinstalling them. What should I do?

2 Answers 2

1

The Problem seems to be that you are trying to use Bootstrap which is available for React but not for React Native.

Try to find a different Library that supports your needs like React Native Elements (https://reactnativeelements.com/) or use the Elements that you get from React Native directly.

Sign up to request clarification or add additional context in comments.

1 Comment

react-native-paper is the best (personal choice). native-base is also good.
0

It worked for me

npm install react-bootstrap

and

import { Button } from 'react-bootstrap';

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.