src/app/legacy/containers/EpisodeList/helpers.jsx

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import React, { forwardRef } from 'react';

// Used to make props passed to <EpisodeList> available to children
export const EpisodeContext = React.createContext({});
export const withEpisodeContext = Component =>
  forwardRef((props, ref) => (
    <EpisodeContext.Consumer>
      {context => <Component {...context} {...props} ref={ref} />}
    </EpisodeContext.Consumer>
  ));