# Ionic react without using typescript

**URL:** <https://forum.ionicframework.com/t/ionic-react-without-using-typescript/205852>\
**Category:** Ionic React\
**Created:** [March 3, 2021, 3:03pm UTC](https://forum.ionicframework.com/t/ionic-react-without-using-typescript/205852 "2021-03-03T15:03:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elias1984](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/elias1984/32/136832_2.png) [@Elias1984](https://forum.ionicframework.com/u/Elias1984)\
**Post date:** [March 3, 2021, 3:03pm UTC](https://forum.ionicframework.com/t/ionic-react-without-using-typescript/205852/1 "2021-03-03T15:03:44Z")

</div>

hello, can i use ionic react without typescript, same way we built with react js?

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [March 3, 2021, 4:00pm UTC](https://forum.ionicframework.com/t/ionic-react-without-using-typescript/205852/2 "2021-03-03T16:00:04Z")

</div>

Sure, you could, you just need to rename the file from `.tsx` to `.js`, remove the tsconfig, and remove typescript.

Though I do not suggest doing this as typescript provides a better and safer development experience compared to traditional Javascript.

---

<div class="post-metadata">

**Author:** ![Elias1984](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/elias1984/32/136832_2.png) [@Elias1984](https://forum.ionicframework.com/u/Elias1984)\
**Post date:** [March 3, 2021, 4:26pm UTC](https://forum.ionicframework.com/t/ionic-react-without-using-typescript/205852/3 "2021-03-03T16:26:48Z")

</div>

Hello, thank you for your respond .  
i really like ionic, but i see it not working good on react, and it work randomly .  
let me explain what i mean.  
in my app , i have button

1-

```auto
<IonButton
  color="primary"
  size="large"
  onClick={() => {
    history.push(`/virtual/${product._id}`, {
      id: product._id,
    });
  }}
>
  360 tour
</IonButton>;

```

where this button is sending the product.\_id like props to second screen…

2- where in app.js  
i defined this

```auto
 <Route path="/virtual/:id">
  <Threesixty />
</Route>

```

3- and inside the ` <Threesixty />` component i used

```auto
import { useHistory, useParams } from 'react-router-dom';
  const { id } = useParams();

<IonText color="primary">

          <h1>{id}</h1>

        </IonText>

```

the id showing randomly … i think there is kind of bug here !!  
the id not shows … where in desktio while testing it shows .

can you advice me ?

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [March 3, 2021, 4:29pm UTC](https://forum.ionicframework.com/t/ionic-react-without-using-typescript/205852/4 "2021-03-03T16:29:47Z")

</div>

Can you make this into a demo app and push a git repo to github? From the sound of things, it’s doesn’t appear to be an ionic specific issue, but probably something in your code.

---

<div class="post-metadata">

**Author:** ![Elias1984](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/elias1984/32/136832_2.png) [@Elias1984](https://forum.ionicframework.com/u/Elias1984)\
**Post date:** [March 3, 2021, 4:41pm UTC](https://forum.ionicframework.com/t/ionic-react-without-using-typescript/205852/5 "2021-03-03T16:41:56Z")

</div>

Hi.  
please check this

> **[eliaskh/IonicTest](https://github.com/eliaskh/IonicTest)**
>
> Contribute to eliaskh/IonicTest development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [March 3, 2021, 5:20pm UTC](https://forum.ionicframework.com/t/ionic-react-without-using-typescript/205852/6 "2021-03-03T17:20:35Z")

</div>

Ooook, so a few things…

1. Pages vs Components: Right now you have the Home Page which, has a page, header, and content area. Then you load the Product List, which also has it’s own page, header, and content. You should **not** be nesting pages/header/content like this.

You’re product list component should just be something like…

```auto
export default function AllProductList({ products }) {
...
return (
    <>
      {products.map((product, index) => ( <IonCard>...</IonCard> )}
    </>
  )
}

```

The same comment would go for your MainProductCard component

1. Your HomePage’s loading indicator. Inlineing conditional render should be done withint the `IonContent`. Otherwise, you are creating multiple element that may or may not be transistioned in.

What the dom shows with your original example.

 ![](https://global.discourse-cdn.com/ionicframework/original/3X/5/4/54a7826fdcd5d865f853150fbe2b440a8e10053a.gif)

TO clean it up, just move the “loading” part into the ion-content.

```auto
  return (
    <IonPage>
      <IonHeader>
        <IonToolbar>
          <IonTitle>Home</IonTitle>
        </IonToolbar>
      </IonHeader>

      <IonContent fullscreen>
        {loading ? (
          <IonText>loading...</IonText>
        ) : (
          <AllProductList products={products} />
        )}
      </IonContent>
    </IonPage>
  );

```

---

<div class="post-metadata">

**Author:** ![Elias1984](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/elias1984/32/136832_2.png) [@Elias1984](https://forum.ionicframework.com/u/Elias1984)\
**Post date:** [March 3, 2021, 6:24pm UTC](https://forum.ionicframework.com/t/ionic-react-without-using-typescript/205852/7 "2021-03-03T18:24:49Z")

</div>

Hello, thank you for this support … i really like the way you support me … very professional.  
i appreciate your efforts.  
that why Ionic has a lot of users … and it is a very good platform.  
i have some questions, cause i amionic new in this platform.  
1- everything used in react js can be used here also? mean can i choose external npm that works with react js ?  
2- with Ionic react can i built big applications, with a lot of data?  
3- is capacitor export really native apps?  
4- all the [Native APIs - Ionic Documentation](https://ionicframework.com/docs/native) ,  
ionic native working with ionic react , mean i can use them ?

Best regards  
Elias

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [March 3, 2021, 6:41pm UTC](https://forum.ionicframework.com/t/ionic-react-without-using-typescript/205852/8 "2021-03-03T18:41:50Z")

</div>

1. Yep! Ionic and react make full use of the web. So any web npm package can be used.

2. Yep, you just need to be carefully loading too much data at one time. This is generally just a best practice in any app setup.

3. Yes, capacitor builds native apps for you. I’d suggest taking a look at the docs here.

> **[Capacitor: Cross-platform native runtime for web apps](https://capacitorjs.com/docs)**
>
> Build iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript

1. So you can use ionic-native in a capacitor app, more as a migration process here  
[Capacitor - build cross platform apps with the web](https://capacitorjs.com/docs/cordova/using-cordova-plugins)

---

<div class="post-metadata">

**Author:** ![vitalijalbu](https://avatars.discourse-cdn.com/v4/letter/v/c67d28/32.png) [@vitalijalbu](https://forum.ionicframework.com/u/vitalijalbu)\
**Post date:** [June 28, 2023, 2:50pm UTC](https://forum.ionicframework.com/t/ionic-react-without-using-typescript/205852/9 "2023-06-28T14:50:13Z")

</div>

will it affect some app performance?? using v7
