Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
fix(GoogleMaps): replace isMapAlreadyRender with isMapReady
Browse files Browse the repository at this point in the history
  • Loading branch information
samouss committed May 14, 2018
1 parent 6f807f4 commit 9081e90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/react-instantsearch-dom-geo/src/GoogleMaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class GoogleMaps extends Component {
};

state = {
isMapAlreadyRender: false,
isMapReady: false,
};

getChildContext() {
Expand Down Expand Up @@ -53,7 +53,7 @@ class GoogleMaps extends Component {
});

this.setState(() => ({
isMapAlreadyRender: true,
isMapReady: true,
}));
}

Expand Down Expand Up @@ -85,12 +85,12 @@ class GoogleMaps extends Component {

render() {
const { cx, children } = this.props;
const { isMapAlreadyRender } = this.state;
const { isMapReady } = this.state;

return (
<div ref={c => (this.element = c)} className={cx('')}>
<div className={cx('map')} />
{isMapAlreadyRender && children}
{isMapReady && children}
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('GoogleMaps', () => {

expect(wrapper).toMatchSnapshot();
expect(wrapper.state()).toEqual({
isMapAlreadyRender: false,
isMapReady: false,
});
});

Expand All @@ -59,7 +59,7 @@ describe('GoogleMaps', () => {

expect(wrapper).toMatchSnapshot();
expect(wrapper.state()).toEqual({
isMapAlreadyRender: false,
isMapReady: false,
});

// Simulate didMount
Expand All @@ -70,7 +70,7 @@ describe('GoogleMaps', () => {

expect(wrapper).toMatchSnapshot();
expect(wrapper.state()).toEqual({
isMapAlreadyRender: true,
isMapReady: true,
});
});

Expand Down

0 comments on commit 9081e90

Please sign in to comment.