Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ export default GoogleApiWrapper({
})(MapContainer)
```

If you want a custom class for the top level 'div'

```javascript
export default GoogleApiWrapper({
apiKey: (YOUR_GOOGLE_API_KEY_GOES_HERE),
wrapperClassName: 'my-custom-css-class'
})(MapContainer)
```

## Sample Usage With Lazy-loading Google API:

```javascript
Expand Down
4 changes: 3 additions & 1 deletion src/GoogleApiComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ export const wrapper = input => WrappedComponent => {
// Store information about loading container
this.LoadingContainer =
options.LoadingContainer || DefaultLoadingContainer;
// add custom className to the top div
this.wrapperClassName = options.wrapperClassName || '';
}

onLoad(err, tag) {
Expand All @@ -116,7 +118,7 @@ export const wrapper = input => WrappedComponent => {
});

return (
<div>
<div className={this.wrapperClassName}>
<WrappedComponent {...props} />
<div ref="map" />
</div>
Expand Down