Skip to content
Permalink
Browse files

fix: send Context instead of Context.Consumer react-context-toolbox (#…

…3368)

As outlined in react-restart/context#9, context toolbox
needs to only use only Context, not Context.Consumer
  • Loading branch information
nathanstitt authored and jquense committed Nov 13, 2018
1 parent 3be79b6 commit 8ead3714f13380fe82f19fd958d3d81d2ba102e5
Showing with 6 additions and 6 deletions.
  1. +1 −1 src/Dropdown.js
  2. +1 −1 src/FormControl.js
  3. +1 −1 src/FormLabel.js
  4. +1 −1 src/Nav.js
  5. +1 −1 src/TabPane.js
  6. +1 −1 www/src/components/Heading.js
@@ -145,7 +145,7 @@ const UncontrolledDropdown = createBootstrapComponent(
);

const DecoratedDropdown = mapContextToProps(
SelectableContext.Consumer,
SelectableContext,
(onSelect, props) => ({
onSelect: chain(props.onSelect, onSelect),
}),
@@ -141,7 +141,7 @@ const mapContext = ({ controlId }, { id }) => {
};

const DecoratedFormControl = mapContextToProps(
FormContext.Consumer,
FormContext,
mapContext,
createBootstrapComponent(FormControl, {
prefix: 'form-control',
@@ -82,7 +82,7 @@ const mapContext = ({ controlId }, { htmlFor }) => {
};

export default mapContextToProps(
FormContext.Consumer,
FormContext,
mapContext,
createBootstrapComponent(FormLabel, 'form-label'),
);
@@ -138,7 +138,7 @@ const UncontrolledNav = uncontrollable(createBootstrapComponent(Nav, 'nav'), {
});

const DecoratedNav = mapContextToProps(
[NavbarContext.Consumer, CardContext.Consumer],
[NavbarContext, CardContext],
(navbarContext, cardContext, { navbar }) => {
if (!navbarContext && !cardContext) return {};

@@ -150,7 +150,7 @@ class TabPane extends React.Component {
}

export default mapContextToProps(
TabContext.Consumer,
TabContext,
(context, props) => {
if (!context) return null;
const { activeKey, getControlledId, getControllerId, ...rest } = context;
@@ -43,7 +43,7 @@ class Heading extends React.Component {
}

export default mapContextToProps(
TocContext,
TocContext.Consumer,
c => ({ registerNode: c.registerNode }),
Heading,
);

0 comments on commit 8ead371

Please sign in to comment.
You can’t perform that action at this time.