I have a prop driven that takes its value from another prop source. driven can be passed a value itself, breaking that link, but by default it follows it.
Setting a default prop for source is straightforward, but how can I reference source in driven's default prop.
const Example = ({source = 'foo', driven = source}) => <div />
Example.defaultProps = {
source: 'foo',
driven: /* ? */
}
If you need
drivento be an alias forsource, you can use a nullish-coalescing operation inside the component memoization: