# What is better to use in JSX?

**URL:** <https://forum.kirupa.com/t/what-is-better-to-use-in-jsx/655468>\
**Category:** Uncategorized\
**Created:** [December 13, 2022, 6:07pm UTC](https://forum.kirupa.com/t/what-is-better-to-use-in-jsx/655468 "2022-12-13T18:07:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruslan0308c](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ruslan0308c/32/19912_2.png) [@Ruslan0308c](https://forum.kirupa.com/u/Ruslan0308c)\
**Post date:** [December 13, 2022, 6:07pm UTC](https://forum.kirupa.com/t/what-is-better-to-use-in-jsx/655468/1 "2022-12-13T18:07:32Z")

</div>

Hello, I recently started learning React and I’m wondering what is better to use in JSX, a function or a class. I will be glad if you answer and explain why it is better.

---

<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:** [December 14, 2022, 1:07am UTC](https://forum.kirupa.com/t/what-is-better-to-use-in-jsx/655468/2 "2022-12-14T01:07:32Z")

</div>

**Functional components.**

It used to be that there were tangible differences between class and function-based components, but in more recent versions of React, functional components are preferred. This article goes into a bit more detail:

[React component guide: Class vs functional](https://www.educative.io/blog/react-component-class-vs-functional)

---

<div class="post-metadata">

**Author:** ![Ruslan0308c](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ruslan0308c/32/19912_2.png) [@Ruslan0308c](https://forum.kirupa.com/u/Ruslan0308c)\
**Post date:** [December 14, 2022, 11:51am UTC](https://forum.kirupa.com/t/what-is-better-to-use-in-jsx/655468/3 "2022-12-14T11:51:41Z")

</div>

thanks
