Skip to content

Instantly share code, notes, and snippets.

@SahanAmarsha
Created January 24, 2022 19:14
Show Gist options
  • Save SahanAmarsha/908d3c2ac8d5039034fbaad06f2f52e0 to your computer and use it in GitHub Desktop.
Save SahanAmarsha/908d3c2ac8d5039034fbaad06f2f52e0 to your computer and use it in GitHub Desktop.
const [name, setName] = useState("");
const [price, setPrice] = useState("");
const [description, setDescription] = useState("");
const [imageUrl, setImageUrl] = useState("");
const addCarOverrides = {
"Flex.Flex[0].Flex[1].TextField[0]": {
onChange: (event) => {
setName(event.target.value);
},
},
"Flex.Flex[0].Flex[1].TextField[1]": {
onChange: (event) => {
setPrice(event.target.value);
},
},
"Flex.Flex[0].Flex[1].TextField[2]": {
onChange: (event) => {
setDescription(event.target.value);
},
},
"Flex.Flex[0].Flex[1].TextField[3]": {
onChange: (event) => {
setImageUrl(event.target.value);
},
},
"Flex.Flex[0].Flex[2].Button[0]": {
onClick: () => {
// save data
},
},
};
return (
...
<AddCar overrides={addCarOverrides} style={{ textAlign: "left", margin: "1rem" }} />
...
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment