Kibana React - error when importing

Hi all,

I'm trying to explore what "kibana-react" does. I went through the github code (https://github.com/elastic/kibana/tree/master/src/plugins/kibana_react) and tried to follow the instructions from the readme and apply them to my plugin. When I try to use my plugin, I get the following error:

image

This is how i import 'kibana-react' (I do it exactly as shown in the github link I shared above):
image

Any tips on how I can solve this issue?

Does your app import its own version of react? Might be best to just use the version that ships with Kibana. Here is an example plugin that sets up a react router that you can follow

Also a sample of the same issue discussed here: Creating custom Kibana plugin in React

also copying CC @jbudz for more inputs.

I'm using the version that ships with Kibana. I don't need react router, I just need to be able to access KibanaContextProvider. In the github link I shared, the examples import KibanaContextProvider from kibana-react using import { KibanaContextProvider } from 'kibana-react'. However when I try the same thing in my plugin, I get the error cant resolve kibana-react.