# syntax

**URL:** <https://forum.kirupa.com/t/syntax/659114>\
**Category:** Uncategorized\
**Created:** [June 3, 2023, 4:30pm UTC](https://forum.kirupa.com/t/syntax/659114 "2023-06-03T16:30:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andy\_Leroy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/andy_leroy/32/22205_2.png) [@Andy\_Leroy](https://forum.kirupa.com/u/Andy_Leroy)\
**Post date:** [June 3, 2023, 4:30pm UTC](https://forum.kirupa.com/t/syntax/659114/1 "2023-06-03T16:30:21Z")

</div>

```auto
import React from 'react';
class App extends React.Component {
render() {
return (
<div>
<h1>Header</h1>
<h2>Content</h2>
<p>This is the content!!!</p>
</div>
);
}
}
export default App;

```

when i check other sources i see the import statement at the beginning of a component . must i alwyas do that? it does not seem to be in the first part of the book. also what is the purpose of expor default statement? is there an alternative syntax for the export default statement in the book?

---

<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:** [June 4, 2023, 4:46pm UTC](https://forum.kirupa.com/t/syntax/659114/2 "2023-06-04T16:46:25Z")

</div>

The first part of book simplifies the early days of learning about React by allowing you to reference a JavaScript file that is more familiar to many developers. I evolve that later to use a build-approach where you reference a module containing the React files. The import and export statements are a consequence of that more advanced approach that is going to be how you will typically use React in production or real-world scenarios outside of learning 🙂
