goalert icon indicating copy to clipboard operation
goalert copied to clipboard

ui/tech-debt: JSX.Element has been deprecated

Open Forfold opened this issue 1 year ago • 5 comments

We'll need to rethink our component typings, as JSX as a whole has been deprecated in favor of React.JSX.

This is a good opportunity to decide if we want all of our components to be one of:

  • React.JSX
  • React.ReactNode (allows null, may be most preferred to work well with Suspense down the road)
  • React.FC<Props>

Screenshot 2023-11-08 at 8 45 37 AM

Forfold avatar Nov 08 '23 17:11 Forfold

I think ReactNode is the preferred way and what we intended JSX to be used for

mastercactapus avatar Nov 08 '23 17:11 mastercactapus

Agreed, I would be fine with moving towards ReactNode from the top down

Forfold avatar Nov 08 '23 17:11 Forfold

@Forfold is this issue beginner friendly?

Kamlesh72 avatar Dec 17 '23 17:12 Kamlesh72

Yes and no. It doesn't require a ton of effort, but it's a bit of a spiderweb in that I've noticed if I flip certain files to ReactNode from JSX.Element it freaks out saying it's not expected. So I think we need to start with the components at the highest level

Forfold avatar Dec 18 '23 17:12 Forfold

Yes and no. It doesn't require a ton of effort, but it's a bit of a spiderweb in that I've noticed if I flip certain files to ReactNode from JSX.Element it freaks out saying it's not expected. So I think we need to start with the components at the highest level

Got it @Forfold. Seems moderate level. Waiting for your PR 😃

Kamlesh72 avatar Dec 18 '23 17:12 Kamlesh72