Skip to content

Commit c5fbf29

Browse files
authored
fix appears (#376)
* fix appears * Move one-page links to unpkg. * disabling silly no setState in mount lint rule. SILLY
1 parent b47e236 commit c5fbf29

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

one-page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700" rel="stylesheet" type="text/css">
99
<link href="https://unpkg.com/prismjs@1/themes/prism-tomorrow.css" rel="stylesheet" type="text/css">
1010
<link href="https://unpkg.com/normalize.css@7/normalize.css" rel="stylesheet" type="text/css">
11-
<link href="./lib/themes/default/index.css" rel="stylesheet" type="text/css">
11+
<link href="https://unpkg.com/spectacle/lib/themes/default/index.css" rel="stylesheet" type="text/css">
1212
</head>
1313
<body>
1414
<div id="root"></div>

src/components/appear.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable react/no-did-mount-set-state */
2+
13
import React, { Component } from 'react';
24
import PropTypes from 'prop-types';
35
import { findDOMNode } from 'react-dom';
@@ -10,6 +12,17 @@ class Appear extends Component {
1012
active: false,
1113
};
1214

15+
componentDidMount() {
16+
const shouldDisableAnimation =
17+
this.props.route.params.indexOf('export') !== -1 ||
18+
this.props.route.params.indexOf('overview') !== -1;
19+
20+
if (shouldDisableAnimation) {
21+
this.setState({ active: true });
22+
return;
23+
}
24+
}
25+
1326
componentWillReceiveProps(nextProps) {
1427
const state = nextProps.fragment;
1528
const slide = this.props.route.slide;
@@ -19,8 +32,8 @@ class Appear extends Component {
1932
});
2033

2134
const shouldDisableAnimation =
22-
this.props.route.params.indexOf('export') !== -1 ||
23-
this.props.route.params.indexOf('overview') !== -1;
35+
nextProps.route.params.indexOf('export') !== -1 ||
36+
nextProps.route.params.indexOf('overview') !== -1;
2437

2538
if (shouldDisableAnimation) {
2639
this.setState({ active: true });

src/components/manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ export default class Manager extends Component {
659659
: ''}
660660

661661
{this.props.globalStyles &&
662-
<Style rules={Object.assign(this.context.styles.global, globals)} />}
662+
<Style rules={Object.assign({}, this.context.styles.global, globals)} />}
663663
</div>
664664
);
665665
}

0 commit comments

Comments
 (0)