From 305c52a315d6eb5f60b46c3b1094f5d4e0d7056e Mon Sep 17 00:00:00 2001 From: Tom Chen Date: Wed, 14 Oct 2015 08:06:02 +0800 Subject: [PATCH] docs(README.md): add section "Map Event Triggers" * Original commits: 1a144fd060dfeaf1b3937f4933afea188a8ce0a6, 5e0fcf87a896f2758b37b01518d1b419f0a9792f, 3610a69b35fb03bba463d07eee7c8492148cab29, da21acbe00b39acfb6110eeba66260a9cb9d8023 * Original author: @hsin421 * Closes #131 --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 7e7f042b..eb871fca 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,19 @@ Every props mentioned in __Rule 2__ could be either [controlled](https://faceboo Anything that are inside components' `options` property could __ONLY__ be accessible via `props.options`. It's your responsibility to manage `props.options` object during the React lifetime for your component. My suggestion is, always use __Rule 3__ if possible. Only use `options` when it's necessary. +### Map Event Triggers + +One common event trigger is to resize map after the size of the container div changes: + +```js +componentDidUpdate() { + var map = React.findDOMNode(this.refs.map); + window.google.maps.event.trigger(map, 'resize'); +} + + ... +``` + ### Check the examples Static hosted [demo site][demo] on GitHub. The code is located under [examples/gh-pages][examples_gh_pages] folder.