About Cacher
Web App
Download
Sign In
Sign Up
menu
Cacher is the code snippet organizer for pro developers
We empower you and your team to get more done, faster
Learn More
bradxr
1/7/2019 - 1:20 PM
share
Share
add_circle_outline
Save
35 - Returning Adjacent Elements (React 16+)
snippet.md
content_copy
file_download
Rendered
Source
may return an array of elements, but not elements 'sitting next to each other'
each array item requires a key
higher order components: normal react components that have a specialty, wrap other components to add a certain functionality
Aux.js: ... import const aux = (props) => props.children; ...export
import Aux from '../../hoc/Aux';
code can be wrapped in
<Aux>...</Aux>
A good use case for HOCs is when a wrapping div takes a css class, this can be handled with a HOC with props.classes
clear