Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
value={{
router: this.router,
match: renderArgs,
}}
>
{element}
);
}
}
BaseRouter.propTypes = propTypes;
// FIXME: For some reason, using contextType doesn't work here.
return mapContextToProps(
{
consumers: ReactReduxContext,
mapToProps: ({ store }) => ({ store }),
displayName: 'withStore(BaseRouter)',
},
BaseRouter,
);
}
return (
);
}
}
export default mapContextToProps(
[SelectableContext, TabContext],
(parentOnSelect, tabContext, { role }) => {
if (!tabContext) return { parentOnSelect };
const { activeKey, getControllerId, getControlledId } = tabContext;
return {
activeKey,
parentOnSelect,
role: role || 'tablist',
// pass these two through to avoid having to listen to
// both Tab and Nav contexts in NavLink
getControllerId,
getControlledId,
};
},
AbstractNav,
export default function withRouter(Component) {
return mapContextToProps(
{
consumers: RouterContext,
mapToProps: context => context,
displayName: `withRouter(${Component.displayName || Component.name})`,
},
Component,
);
}
if (!registerNode) return;
registerNode(parseInt(h, 10), title, id);
}
render() {
const { h, id, children, className } = this.props;
const H = `h${h}`;
return (
<div>{children}</div>
);
}
}
export default mapContextToProps(
TocContext,
c => ({ registerNode: c.registerNode }),
Heading,
);