correct-apricot
correct-apricot16mo ago

AntdInferencer not working even adjusting the new API

return <AntdInferencer resource="blogs" action="list" />;
No description
11 Replies
kapa.ai
kapa.ai16mo 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: ----------------------
kapa.ai
kapa.ai16mo ago
<@329809837338656770> kapa.ai is still learning and improving, please let us how it did by reacting below
correct-apricot
correct-apricot16mo ago
um using nextjs
extended-yellow
extended-yellow16mo ago
Hey @pkalib, Did you define your resources in <Refine> component?
correct-apricot
correct-apricot16mo ago
yes
correct-apricot
correct-apricot16mo ago
No description
extended-yellow
extended-yellow16mo ago
Can you explain in details such as console errors?
correct-apricot
correct-apricot16mo ago
there is no error actualy it just dont render
extended-yellow
extended-yellow16mo 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.
stormy-gold
stormy-gold16mo 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?
correct-apricot
correct-apricot16mo ago
Sure I will the project was created via cli then I updated it since it prompted new changes