Minor Changes
-
Command palette for the refine. this package use kbar to generate the command palette.
💡 How use the refine-kbar command palette?
- Import the package
import { RefineKbarProvider } from "@pankod/refine-kbar";
- Wrap the
<Refine>
component with the<RefineKbarProvider>
.
import { Refine } from "@pankod/refine-core"; import { RefineKbarProvider } from "@pankod/refine-kbar"; const App: React.FC = () => { return ( <RefineKbarProvider> <Refine /> </RefineKbarProvider> ); };
- Create
<OffLayoutArea/>
component for the Refine component and use therefine-kbar
command palette in<OffLayoutArea>
We have the
<RefineKbar>
component to provide the command palette to the<Refine>
component.import { Refine } from "@pankod/refine-core"; import { RefineKbarProvider, RefineKbar } from "@pankod/refine-kbar"; const OffLayoutArea: React.FC = () => { return <RefineKbar />; }; const App: React.FC = () => { return ( <RefineKbarProvider> <Refine OffLayoutArea={OffLayoutArea} /> </RefineKbarProvider> ); };
Note 📢
Q: Why we need to wrap the<Refine>
component with the<RefineKbarProvider>
?
A: The<RefineKbarProvider>
is a wrapper component that provides the command palette to the<Refine>
component.
Q: Why we need to add<OffLayoutArea>
to the<Refine>
component?
A: Because we need to reach theresources
property of the<Refine>
component.