# Creating React Perspective Components

**URL:** <https://forum.inductiveautomation.com/t/creating-react-perspective-components/95027>\
**Category:** Module Development\
**Tags:** perspective\
**Created:** [August 22, 2024, 6:04pm UTC](https://forum.inductiveautomation.com/t/creating-react-perspective-components/95027 "2024-08-22T18:04:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Zhou](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Jason\_Zhou](https://forum.inductiveautomation.com/u/Jason_Zhou)\
**Post date:** [August 22, 2024, 6:04pm UTC](https://forum.inductiveautomation.com/t/creating-react-perspective-components/95027/1 "2024-08-22T18:04:16Z")

</div>

I have a pretty straightforward question (hopefully). Is it possible to implement a react component in a module, as a functional component as opposed to a class component? It seems like there are a lot of classes from [@inductiveautomation](https://forum.inductiveautomation.com/groups/inductiveautomation)/perspective-client that are meant to be extended, but I wanted to ask just to be sure.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 22, 2024, 6:09pm UTC](https://forum.inductiveautomation.com/t/creating-react-perspective-components/95027/2 "2024-08-22T18:09:24Z")

</div>

Should be:

> [@Perspective ComponentMeta Typing Issue](https://forum.inductiveautomation.com/t/perspective-componentmeta-typing-issue/94730/4):
>
> Hm, I’m not sure. Maybe someone experienced with class based components can chime in, I’ve only used the functional style. Not sure if it’s useful but this is my “starter” component. import \* as React from 'react' import { ComponentMeta, ComponentProps, PComponent, PropertyTree, SizeObject, } from '@inductiveautomation/perspective-client' import { useState } from 'react' export const COMPONENT\_TYPE = 'mussonindustrial.display.example' interface ExampleComponentProps { …

---

<div class="post-metadata">

**Author:** ![Jason\_Zhou](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Jason\_Zhou](https://forum.inductiveautomation.com/u/Jason_Zhou)\
**Post date:** [August 22, 2024, 6:31pm UTC](https://forum.inductiveautomation.com/t/creating-react-perspective-components/95027/3 "2024-08-22T18:31:50Z")

</div>

Okay, so it should be possible. Could I get your opinion on functional vs. class components in Ignition. Functional is what I'm used to already and has more options with hooks, but is there something specific to Ignition that could give class component implementation an advantage?

Edit: or in other words, is there any reason why I wouldn't want to go with implementing functional components?

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [August 22, 2024, 8:40pm UTC](https://forum.inductiveautomation.com/t/creating-react-perspective-components/95027/4 "2024-08-22T20:40:16Z")

</div>

> [@Jason\_Zhou](#):
>
> Edit: or in other words, is there any reason why I wouldn't want to go with implementing functional components?

Nope, you want to use functional components.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 22, 2024, 8:52pm UTC](https://forum.inductiveautomation.com/t/creating-react-perspective-components/95027/5 "2024-08-22T20:52:57Z")

</div>

There's zero practical difference as far as I know (not a React/front end dev primarily), so yeah, go with whatever is more comfortable for you.
