bradxr
1/7/2019 - 1:20 PM

35 - Returning Adjacent Elements (React 16+)

  • 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