Skip to content

Commit

Permalink
fix(addons/InfoBox): allow children to receive React's context
Browse files Browse the repository at this point in the history
  • Loading branch information
benwiley4000 committed Oct 14, 2016
1 parent ca73c85 commit 5748a96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/addons/InfoBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "react";

import {
render,
unstable_renderSubtreeIntoContainer,
} from "react-dom";

import {
Expand Down Expand Up @@ -65,8 +65,8 @@ const publicMethodMap = {
};

const controlledPropUpdaterMap = {
children(infoWindow, children) {
render(Children.only(children), infoWindow.getContent());
children(infoWindow, children, component) {
unstable_renderSubtreeIntoContainer(component, Children.only(children), infoWindow.getContent());
},
options(infoBox, options) { infoBox.setOptions(options); },
position(infoBox, position) { infoBox.setPosition(position); },
Expand Down Expand Up @@ -142,7 +142,7 @@ export default _.flowRight(

componentDidMount() {
const infoBox = getInstanceFromComponent(this);
controlledPropUpdaterMap.children(infoBox, this.props.children);
controlledPropUpdaterMap.children(infoBox, this.props.children, this);
},

componentWillReceiveProps(nextProps, nextContext) {
Expand Down

0 comments on commit 5748a96

Please sign in to comment.