Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import * as React from 'react';
- import { withContext, getContext, mapProps, compose } from 'recompose';
- import * as PropTypes from 'prop-types';
- import { Requireable } from 'prop-types';
- const provideValue = withContext<{}, { value: string }>(
- {
- value: PropTypes.string
- },
- ({ value }) => ({ value })
- );
- const Wrapper: React.SFC<{ value: string }> = ({ children }) => <>{children}</>;
- export const ValueProvider = provideValue(Wrapper);
- export const connectValue = compose<{ value: string }, {}>(getContext({ value: PropTypes.string }));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement