Skip to content

Commit

Permalink
pass context.Consumer to mapContextToProps
Browse files Browse the repository at this point in the history
As outlined in react-restart/context#9, context toolbox
needs to only use Context.Consumer since it can't
navigate to the Consumer property reliably.
  • Loading branch information
nathanstitt committed Nov 11, 2018
1 parent 3be79b6 commit ffb8e23
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/AbstractNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class AbstractNav extends React.Component {
}

export default mapContextToProps(
[SelectableContext, TabContext],
[SelectableContext.Consumer, TabContext.Consumer],
(parentOnSelect, tabContext, { role }) => {
if (!tabContext) return { parentOnSelect };

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

export default mapContextToProps(
[SelectableContext, NavContext],
[SelectableContext.Consumer, NavContext.Consumer],
(onSelect, navContext, props) => {
const { activeKey } = navContext || {};
const key = makeEventKey(props.eventKey, props.href);
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/Heading.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Heading extends React.Component {
}

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

0 comments on commit ffb8e23

Please sign in to comment.