I have a component that I can’t change. Its content is fixed and out of my reach.
function Button(props) {
return <button {...props} />
}
Can be used as:
<Button onClick={...} disabled={...} />
My question is if it is possible to combine the props I send to it in a single “super” prop, e.g.
<Button componentProps={{ onClick: ..., disabled: ... }} />
without changing the component’s code. Similar to how you can either nest children or use the children
prop to pass them.
2