Skip to content

Commit

Permalink
fix: send Context instead of Context.Consumer react-context-toolbox (#…
Browse files Browse the repository at this point in the history
…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 8ead371
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Dropdown.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const UncontrolledDropdown = createBootstrapComponent(
); );


const DecoratedDropdown = mapContextToProps( const DecoratedDropdown = mapContextToProps(
SelectableContext.Consumer, SelectableContext,
(onSelect, props) => ({ (onSelect, props) => ({
onSelect: chain(props.onSelect, onSelect), onSelect: chain(props.onSelect, onSelect),
}), }),
Expand Down
2 changes: 1 addition & 1 deletion src/FormControl.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const mapContext = ({ controlId }, { id }) => {
}; };


const DecoratedFormControl = mapContextToProps( const DecoratedFormControl = mapContextToProps(
FormContext.Consumer, FormContext,
mapContext, mapContext,
createBootstrapComponent(FormControl, { createBootstrapComponent(FormControl, {
prefix: 'form-control', prefix: 'form-control',
Expand Down
2 changes: 1 addition & 1 deletion src/FormLabel.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const mapContext = ({ controlId }, { htmlFor }) => {
}; };


export default mapContextToProps( export default mapContextToProps(
FormContext.Consumer, FormContext,
mapContext, mapContext,
createBootstrapComponent(FormLabel, 'form-label'), createBootstrapComponent(FormLabel, 'form-label'),
); );
2 changes: 1 addition & 1 deletion src/Nav.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const UncontrolledNav = uncontrollable(createBootstrapComponent(Nav, 'nav'), {
}); });


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


Expand Down
2 changes: 1 addition & 1 deletion src/TabPane.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class TabPane extends React.Component {
} }


export default mapContextToProps( export default mapContextToProps(
TabContext.Consumer, TabContext,
(context, props) => { (context, props) => {
if (!context) return null; if (!context) return null;
const { activeKey, getControlledId, getControllerId, ...rest } = context; const { activeKey, getControlledId, getControllerId, ...rest } = context;
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/Heading.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Heading extends React.Component {
} }


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

0 comments on commit 8ead371

Please sign in to comment.