Answer the question
In order to leave comments, you need to log in
How to pass record values to a custom component in react-admin?
Good day. Please tell me how to solve the problem.
I am using react-admin.
There is RequestEdit.jsx
Edit component, SimpleForm and TextField components react-admin.
AboutProject is custom mine.
const RequestEdit = props => {
const classes = useEditStyles();
return (
<div>
<AboutProject/>
<Edit
title={<RequestTitle />}
classes={classes}
{...props}
>
<SimpleForm>
<TextField source="name" />
<TextField source="username" />
</SimpleForm>
</Edit>
</div>
);
};
const RequestTitle = ({ record }) => {
return <h2>{record ? `${record.name}` : ''}</h2>;
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question