AntdInferencer not working even adjusting the new API

return <AntdInferencer resource="blogs" action="list" />;
No description
K
kapa.ai385d ago
Hi @pkalib. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information extracts provided, you can use the <AntdInferencer> component to generate a sample list view for your resources. However, the example provided in the extracts does not include the resource and action props. Here's the example from the extracts:
import { Refine } from "@refinedev/core";
import { Layout } from "@refinedev/antd";
import routerProvider from "@refinedev/react-router-v6";
import dataProvider from "@refinedev/simple-rest";

import { BrowserRouter, Routes, Route, Outlet } from "react-router-dom";

import { AntdInferencer } from "@refinedev/inferencer/antd";

const API_URL = "https://api.fake-rest.refine.dev";

const App: React.FC = () => {
return (
<BrowserRouter>
<Refine
routerProvider={routerProvider}
dataProvider={dataProvider(API_URL)}
resources={[
{
name: "samples",
list: "/samples",
},
]}
>
<Routes>
<Route
element={
<Layout>
<Outlet />
</Layout>
}
>
<Route path="/samples" element={<AntdInferencer />} />
</Route>
</Routes>
</Refine>
</BrowserRouter>
);
};
import { Refine } from "@refinedev/core";
import { Layout } from "@refinedev/antd";
import routerProvider from "@refinedev/react-router-v6";
import dataProvider from "@refinedev/simple-rest";

import { BrowserRouter, Routes, Route, Outlet } from "react-router-dom";

import { AntdInferencer } from "@refinedev/inferencer/antd";

const API_URL = "https://api.fake-rest.refine.dev";

const App: React.FC = () => {
return (
<BrowserRouter>
<Refine
routerProvider={routerProvider}
dataProvider={dataProvider(API_URL)}
resources={[
{
name: "samples",
list: "/samples",
},
]}
>
<Routes>
<Route
element={
<Layout>
<Outlet />
</Layout>
}
>
<Route path="/samples" element={<AntdInferencer />} />
</Route>
</Routes>
</Refine>
</BrowserRouter>
);
};
To use the <AntdInferencer> component with the resource and action props, you can modify the example like this:
<Route path="/blogs" element={<AntdInferencer resource="blogs" action="list" />} />
<Route path="/blogs" element={<AntdInferencer resource="blogs" action="list" />} />
Please note that this modification is not directly from the provided extracts, but it's based on the information available in the extracts. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
K
kapa.ai385d ago
<@329809837338656770> kapa.ai is still learning and improving, please let us how it did by reacting below
P
provincial-silver385d ago
um using nextjs
R
rival-black385d ago
Hey @pkalib, Did you define your resources in <Refine> component?
P
provincial-silver385d ago
yes
P
provincial-silver385d ago
No description
R
rival-black385d ago
Can you explain in details such as console errors?
P
provincial-silver385d ago
there is no error actualy it just dont render
R
rival-black385d ago
It's interesting can you create a codesandbox environment to investigate it? Btw, refine.new is using the Inferencer to create projects and they work as expected.
S
sunny-green385d ago
Hey @pkalib any chance to try out the other actions such as show? Are you trying with a new project or migrating an existing one to v4?
P
provincial-silver385d ago
Sure I will the project was created via cli then I updated it since it prompted new changes
More Posts
how to pass additional "meta" for resources to dataProvider?I'm writing a new dataProfider for the WordPress REST API. I need to pass additional parameters for cliis there a shortcut syntax for cli i wanted to create a project that has the answer for the cli promHello everyone I just found this projectHello everyone I just found this project on twitter. And I want to understand the working logic. As Use query parameters to set the initial form valuesCan I use query parameters to set the initial form values for antd's useform? For example, in app.tHow to pass initial values to antd CreateButton componentHi how can I pass initial values to antd CreateButton componentError: A component is changing an uncontrolled input to be controlled.Using `MuiInferencer` on an api that has a boolean field (isActive) it generates the following code:inferencer: determine the relations for more than 1 foreign keys referring to the same target tableHello, i have a table with 3 foreign keys inside a table referring to the same one table. How shouldAdd header button conditionally to antd show componentHow can I add a header button to antd show component based on a if else statementuserwhen i am logged in, I am trying to see my profile page. however, when i console.log the user, I getError refine v4 and antd v5I have a style.less files and used carco config After migration from v3 to v4 at refine gives me errHow to Integrate Refine basic login with token based JWT auth?Hi, I want to integrate refine login with my backend login service built with JWT auth via API.Error: At least one choice must be selectableI am trying to follow the getting started tutorial on refine.dev from our corporate network. The simonSettled error when creating a child itemHey, so we've overriden the save on click handler with our own function to create an "item", then onHow to set useSelect filters dynamically?I want to set filters value of useSelect hook dynamically based on some value from API query. Is theCasbin causes severe lagafter adding access control using Casbin, my app becomes very laggy. code snippet of my accessContrHow to only save file url when uploading to supabaseI'm following the example https://refine.dev/docs/advanced-tutorials/data-provider/supabase/#adding-tokenshi I understand that in the login page (which you use google auth) you use JWT and make tokens then useModal with useFormhi, I was trying out modal create button though I know the code should be working I have no error bhelp with date fieldSorry for my bad english, I'm still a begginer in react, I follow this tutorial tu create a dashboarlogin authhi all when someone do a login you save the profile in localStorage and after that if the user try t