Error creating `category` column in Chakra UI and Strapi v4 data provider
I'm having trouble creating a
category
column in Chakra UI and Strapi v4 data provider. I'm trying to create a PostList page to list all posts from the fake Strapi API "https://api.strapi-v4.refine.dev"
after following these tutorials: https://refine.dev/docs/tutorials/chakra-ui-tutorial/ and https://refine.dev/blog/build-admin-panel-with-material-ui-and-strapi/.
The code in src/pages/list.tsx
and error returned in the browser are attached.
Thank you for helping!Your First App using Chakra UI | refine
Introduction
Building a CRUD app with Material UI and Strapi in React | refine
How to build CRUD admin panel with Material UI?
4 Replies
implicit-lime•3y ago
Hi @michmatics ,
If you are using the
cell
property when defining a column with react-table
, you must return a valid value. In your case, some posts don’t have a category
property, so you are getting an error. You can fix this by adding a try catch block like this:
frail-apricotOP•3y ago
Many thanks @salihozdemir! But I keep getting the same error. I suspect the error is being generated from this part of the code:
Hey @michmatics ,
Do all your items have a "category" property?
Can you try this?
frail-apricotOP•3y ago
Thanks, @Omer. I'll try this. But some of the items were created by someone else since it's an example API with dummy data.