we wanted to know how you could pass an existing/selected record from a List to a create view in react admin.
We have a situation where each entry in our list view has both an Edit and Create button. We want to be able to click on Create for said row and be able to have that row/record info show up in Create. I know this sounds no different than Editing it, but we want to be able to have a Duplicate/Create from Existing feature. If we just used a normal Create view we need to fill in info from scratch. We have cases where we want to create on-top of preexisting data.
Another reason why we ask this is because the react-admin docs specifically state that:
accepts a record prop, to initialize the form based on an value object.
We take this assume that you can pass your selected record into create, we have tried this but it does not seem to work.
Any help appreciated, thanks.
This is what I am thinking:
export const DataCreate = (props) => (
<Create title="Create new " {...props} >
<TabbedForm record={props.record}
//can we do something like this to pass record to create?>
<FormTab label = "Basic Info">
<TextInput source="type" label="type" />