'PrismicTable' cannot be used as a JSX component

Describe your question/issue in detail

I started working with the new Table slice option and after creating the Slice containing it, I set to work in my Next.js/Tailwind project. After adding the new PrismicTable in my code, I noticed the error: 'PrismicTable' cannot be used as a JSX component.

I did the follow things to try and ensure that I could use the PrismicTable in the first place:

  • Updated to the latest Slice Machine version ( npm install --save-dev @slicemachine/adapter-next@latest and npm install --save-dev slice-machine-ui )
  • Updated the react version ( npm install --save @prismicio/react @prismicio/client )
  • Start the server with npm run dev

The weird thing is: The data DOES RENDER . But the error persists.

According to the documentation it shouldn't have to be neccessary to adjust the way you import the PrismicTable.

Impacted feature

PrismicTable

What steps have you taken to resolve this issue already?

Uninstalled and followed the same steps as above.

Errors

PrismicTable' cannot be used as a JSX component.

Your Role

Developer

Hosting provider

Vercel

Package.json file

Anyone who stumbled upon this issue?
Thanks in advance!

Hi @jorikvanruiswijk, this could be because of recent changes to React's TypeScript types.

Could you try an alpha version that includes a possible fix and let us know if it resolves the issue?

npm install @prismicio/react@3.2.1-alpha.0

Thanks!

Hi @angeloashmore !
Thanks, that seems to do the trick!

Cheers!

1 Like

Thanks @jorikvanruiswijk! I released the fix as part of the latest stable version, @prismicio/react v3.2.1.

npm install @prismicio/react@latest