# Kibana React - error when importing

**URL:** <https://discuss.elastic.co/t/kibana-react-error-when-importing/231431>\
**Category:** Kibana\
**Created:** [May 7, 2020, 12:35am UTC](https://discuss.elastic.co/t/kibana-react-error-when-importing/231431 "2020-05-07T00:35:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Gege](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul_gege/32/45595_2.png) [@Paul\_Gege](https://discuss.elastic.co/u/Paul_Gege)\
**Post date:** [May 7, 2020, 12:35am UTC](https://discuss.elastic.co/t/kibana-react-error-when-importing/231431/1 "2020-05-07T00:35:20Z")

</div>

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](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](https://us1.discourse-cdn.com/elastic/original/3X/d/f/df5d2afda2765aafc43a1e2f76114aa0066c7f75.png)

This is how i import 'kibana-react' (I do it exactly as shown in the github link I shared above):  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/3/03edf8f022e60a9373cd1102065b7e4077baa463.png)

Any tips on how I can solve this issue?

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [May 7, 2020, 1:21am UTC](https://discuss.elastic.co/t/kibana-react-error-when-importing/231431/2 "2020-05-07T01:21:33Z")

</div>

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

> <https://github.com/elastic/kibana/blob/7.5/src/legacy/core_plugins/kibana/public/home/components/home_app.js#L63>

Also a sample of the same issue discussed here: [Creating custom Kibana plugin in React](https://discuss.elastic.co/t/creating-custom-kibana-plugin-in-react/156012/3)

also copying CC @jbudz for more inputs.

---

<div class="post-metadata">

**Author:** ![Paul\_Gege](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul_gege/32/45595_2.png) [@Paul\_Gege](https://discuss.elastic.co/u/Paul_Gege)\
**Post date:** [May 7, 2020, 1:40am UTC](https://discuss.elastic.co/t/kibana-react-error-when-importing/231431/3 "2020-05-07T01:40:06Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 4, 2020, 1:40am UTC](https://discuss.elastic.co/t/kibana-react-error-when-importing/231431/4 "2020-06-04T01:40:17Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
