score:0

const context = useContext(FarmContext)

// destructuring assigment 
const { fruit = 'foobar' } = context?.data?.farm?.[0] ?? {} // apple


<Component fruit={fruit} /> // apple

score:1

<script src="//cdnjs.cloudflare.com/ajax/libs/ramda/0.25.0/ramda.min.js"></script>

Related Query

More Query from same tag