Skip to content

asaladino/google-calendar-with-reactjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Calendar with React.js

This is a sample project for integrating the Google Calendar Api with a React.js web app. This project uses the Google Calendar Browser Quickstart as a reference.

Screen Shot 2

Integration

The important part of the integration is to render the react js app after the google api js file is loaded. To achieve this we will need to wrap ReactDOM.render in the index.js file with a window accessible function that can be called on script load.

window.renderReactApp = () => {
    ReactDOM.render(<App
        clientId={keys.clientId}
        apiKey={keys.apiKey}/>, document.getElementById('root'));
};

Then at the bottom of the public/index.html file, we can add our modified google api load script.

<script async defer src="https://apis.google.com/js/api.js"
        onload="this.onload=function(){};if(window.renderReactApp){window.renderReactApp();}"
        onreadystatechange="if (this.readyState === 'complete') this.onload()">

About

Integrate Google Calendar with React.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published