const Button = ({ children, ...props }) => (
<StyledButton {...props} >{ children }</StyledButton>
)
.component {
& > .component-part {
margin: auto;
}
}
const Contrived = () => {
const foo = useFoo()
const bar = usebar()
return (
<div>
<h1>{foo}</h1>
<button onClick={bar}>Submit</button>
</div>
)
}
const useContrivedData = () => {
const foo = useFoo()
const bar = usebar()
return {
foo,
bar,
}
}
const _Contrived = ({ foo, bar = () => {} }) => (
<div>
<h1>{foo}</h1>
<button onClick={bar}>Submit</button>
</div>
)
const Contrived = () => {
const data = useContrivedData()
return </ {...data} _Contrived>
}