Fix issue where Instantclick navigation fails (#1047)

This commit is contained in:
Ben Halpern 2018-10-31 16:31:48 -04:00 committed by GitHub
parent ebd4b50f3f
commit 299e6aeb3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,8 +1,15 @@
import { h, render } from 'preact';
import { GithubRepos } from '../githubRepos/githubRepos';
document.addEventListener('DOMContentLoaded', () => {
function loadElement() {
const root = document.getElementById('github-repos-container');
if (root){
render(<GithubRepos />, root, root.firstElementChild);
}
}
render(<GithubRepos />, root, root.firstElementChild);
window.InstantClick.on('change', () => {
loadElement();
});
loadElement();