question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Server side rendering markup

See original GitHub issue

Thanks for this awesome library. It’s very useful. However, I detected a little bit problem while rendering on the server side.

I noticed there is a <div> containing my marker with a calculated top. This top style do not match in the server generated content and the client side. It differs by a tiny amount but if differs, so the markup is not valid generating this error:

https://www.dropbox.com/s/msiafi5mmr7qi6j/Captura de pantalla 2017-07-04 22.47.24.png?dl=0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
malamancommented, Nov 23, 2017

@valorize in simplest case you can use something like

import GoogleMapReact from 'google-map-react';

export class GoogleMap extends React.Component<IProps, IState> {
    constructor(props) {
        super(props);
        this.state = {
            mounted: false
        };
    }

    componentDidMount() {
        this.setState({mounted: true});
    }

    render() {
        return (
            <div>
                {this.state.mounted > 0 &&
                    <GoogleMapReact
                        bootstrapURLKeys={{key: 'XXXX'}}
                        zoom={this.props.zoom}
                        options={this.props.options}
                        center={this.props.center}                        
                    >
                        {this.props.markers}
                    </GoogleMapReact>
                }
            </div>
        );
    }
}

0reactions
lock[bot]commented, Dec 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReactDOMServer – React
The ReactDOMServer object enables you to render components to static markup. Typically, it's used on a Node server: // ES modules import *...
Read more >
Demystifying server-side rendering in React - freeCodeCamp
Server -Side Rendering — SSR from here on — is the ability of a front-end framework to render markup while running on a...
Read more >
React - Server-rendered markup (renderToString / hydrate)
server-rendered markup is the dynamic possibility of server-side rendering (vs static). The steps are: the web server returns a web page where the...
Read more >
Server Side Rendering – Streaming Markup
In this case, we have a Node stream of React markup being rendered. As each thing is rendered, React fires off a chunk...
Read more >
Streaming Server-Side Rendering - Patterns.dev
renderToStaticMarkup (element) . The HTML output is the same but in a stream format. It can be used for rendering static, non-interactive pages...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found