36 lines
968 B
JavaScript
36 lines
968 B
JavaScript
import 'react-app-polyfill/ie9';
|
|
import 'react-app-polyfill/stable';
|
|
|
|
import React from "react";
|
|
import ReactDOM from "react-dom";
|
|
import Main from "../src/Main.js"
|
|
import TemplatePage from "../src/components/jamtracks/JKJamTracksLandingTemplatePage.js"
|
|
import '../src/helpers/initFA';
|
|
import '../src/i18n/config';
|
|
|
|
const rootElement = document.getElementById("root");
|
|
|
|
// Ensure props are passed correctly (or fetch from the server)
|
|
|
|
const props = window.jamtrack_data ? window.jamtrack_data : {
|
|
id: rootElement.dataset.id,
|
|
plan_code: rootElement.dataset.plan_code,
|
|
slug: rootElement.dataset.slug,
|
|
artist: rootElement.dataset.artist,
|
|
song: rootElement.dataset.song,
|
|
location: window.location.pathname,
|
|
};
|
|
|
|
console.log('init', props, rootElement);
|
|
|
|
// Hydrate the server-rendered React component
|
|
//ReactDOM.hydrate(React.createElement(TemplatePage, props), rootElement);
|
|
|
|
ReactDOM.render(
|
|
<Main>
|
|
<TemplatePage {...props} />
|
|
</Main>, rootElement
|
|
);
|
|
|
|
|