mirror of
https://github.com/Pomax/BezierInfo-2.git
synced 2025-08-30 11:40:27 +02:00
test deploy with renderToString
This commit is contained in:
@@ -2,4 +2,10 @@ var React = require("react");
|
||||
var ReactDOM = require("react-dom");
|
||||
var FullArticle = require("./FullArticle.jsx");
|
||||
|
||||
ReactDOM.render(<FullArticle/>, document.getElementById("article"));
|
||||
// in the browser, do:
|
||||
if (typeof document !== "undefined") {
|
||||
ReactDOM.render(<FullArticle/>, document.getElementById("article"));
|
||||
}
|
||||
|
||||
// in not-the browser, do:
|
||||
module.exports = { FullArticle };
|
||||
|
@@ -12,7 +12,7 @@ var Navigation = React.createClass({
|
||||
var Type = sections[name];
|
||||
var title = Type.getDefaultProps().title;
|
||||
var locale = SectionHeader.locale;
|
||||
if (typeof window !== undefined && window.location.toString().indexOf(locale) === -1) {
|
||||
if (typeof window !== "undefined" && window.location.toString().indexOf(locale) === -1) {
|
||||
locale = '';
|
||||
}
|
||||
var fragmentid = `${locale ? './' + locale + '/': '.'}#${name}`;
|
||||
|
@@ -7,7 +7,7 @@ var SectionHeader = React.createClass({
|
||||
|
||||
render: function() {
|
||||
var locale = SectionHeader.locale;
|
||||
if (typeof window !== undefined && window.location.toString().indexOf(locale) === -1) {
|
||||
if (typeof window !== "undefined" && window.location.toString().indexOf(locale) === -1) {
|
||||
locale = '';
|
||||
}
|
||||
var fragmentid = `${locale ? './' + locale + '/': '.'}#${this.props.name}`;
|
||||
@@ -18,9 +18,11 @@ var SectionHeader = React.createClass({
|
||||
);
|
||||
},
|
||||
componentDidMount() {
|
||||
var h = window.location.hash;
|
||||
if (h) {
|
||||
window.location = window.location.hash;
|
||||
if (typeof window !== "undefined" && window.location) {
|
||||
var h = window.location.hash;
|
||||
if (h) {
|
||||
window.location = window.location.hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user