From 1a3e08cd376386eb5102ef5a6f553105863e8201 Mon Sep 17 00:00:00 2001 From: Nadav Avidan Date: Tue, 15 May 2018 22:16:06 +0300 Subject: [PATCH 1/2] add custom className support for the top level element (currently inaccessible) --- src/GoogleApiComponent.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/GoogleApiComponent.js b/src/GoogleApiComponent.js index c9be4a01..79267743 100644 --- a/src/GoogleApiComponent.js +++ b/src/GoogleApiComponent.js @@ -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) { @@ -116,7 +118,7 @@ export const wrapper = input => WrappedComponent => { }); return ( -
+
From c0196f45334d78bc3611414994f274ee9a3d1b7e Mon Sep 17 00:00:00 2001 From: Nadav Avidan Date: Tue, 15 May 2018 22:24:58 +0300 Subject: [PATCH 2/2] update docs --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 472c9e78..61a228d7 100644 --- a/README.md +++ b/README.md @@ -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