'ReactModal' cannot be used as a JSX component.

Author: bokiboCreated Aug 16, 2022Updated Apr 20, 2026
Labelsnot a bugreactversionstypes definitions

Hi,

I am using this component for certain and it works perfect, don't have any problems. But yesterday I tried to update react from v17 to v18 and after update I got this error

'ReactModal' cannot be used as a JSX component.

Is there any way to fix it so I could continue using this component or this is caused by new react version and fix is needed? So far I did revert to react v17 and it works but in the future I would like to update to version 18.

Thank you