Fix issue where Instantclick navigation fails (#1047)
This commit is contained in:
parent
ebd4b50f3f
commit
299e6aeb3b
1 changed files with 9 additions and 2 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue