2 ms·
Yes. A React Component could be defined as a Functor with contramap function which map props with function. const renderer = props => <h1>Hello {props.pageNa
by revskill 4y ago
Yes. A React Component could be defined as a Functor with contramap function which map props with function.
const renderer = props => <h1>Hello {props.pageName}</h1>
const Title = ReactComponent(renderer).contramap(props => { pageName: props.title })
Title.fold({ title: 'Home page' }) // <h1>Hello Home page</h1>