# "Using Redux with React" question in Chapter 20?

**URL:** <https://forum.kirupa.com/t/using-redux-with-react-question-in-chapter-20/639627>\
**Category:** web dev\
**Created:** [April 7, 2019, 3:01pm UTC](https://forum.kirupa.com/t/using-redux-with-react-question-in-chapter-20/639627 "2019-04-07T15:01:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jasonliao](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@Jasonliao](https://forum.kirupa.com/u/Jasonliao)\
**Post date:** [April 7, 2019, 3:01pm UTC](https://forum.kirupa.com/t/using-redux-with-react-question-in-chapter-20/639627/1 "2019-04-07T15:01:40Z")

</div>

Hi,

There is a point I don’t understand. On page 260, it has the following code in the index.js.

> import App from “./App”;

But there is no “App” component being defined in the App.js (on page 263).  
The end example is working fine, but I am curious is there a typo or something? Why is the example still working even if we import something (“App” component) that doesn’t exist?

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [April 8, 2019, 6:04am UTC](https://forum.kirupa.com/t/using-redux-with-react-question-in-chapter-20/639627/2 "2019-04-08T06:04:37Z")

</div>

It is strange, but here is what is happening. The import is just for the JS file. Anything can be in the JS file you are importing. The part where the compiler is more strict is with the `render` function, which does expect a component called **App**. How do we explain that strangeness?

Inside `App.js`, what we are exporting is a component via `connectedComponent`. More specifically, what gets returned is a new component that maps to `App`. That is why the compiler doesn’t complain when you build the app, for the `App` component does get created in a roundabout way!

---

<div class="post-metadata">

**Author:** ![Jasonliao](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@Jasonliao](https://forum.kirupa.com/u/Jasonliao)\
**Post date:** [April 8, 2019, 9:21pm UTC](https://forum.kirupa.com/t/using-redux-with-react-question-in-chapter-20/639627/3 "2019-04-08T21:21:33Z")

</div>

Hi Kirupa,  
I think I sort of get it.  
Thank you very much for your help. 😀

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [April 9, 2019, 6:14pm UTC](https://forum.kirupa.com/t/using-redux-with-react-question-in-chapter-20/639627/4 "2019-04-09T18:14:32Z")

</div>

Another thing that may help. If you bring up the React Dev Tools (as part of the Chrome Dev Tools), you can see the App component being returned by `connectedComponent` when you inspect the React-ified DOM tree.
