Skip to content

Commit

Permalink
Add the react-perf query to the iframe (#623)
Browse files Browse the repository at this point in the history
* Add the react-perf query to the iframe if that present in the main frame.

* Fix a typo and add correct support for react_perf
  • Loading branch information
arunoda authored Nov 22, 2016
1 parent f84f921 commit ebce3b8
Show file tree
Hide file tree
Showing 3 changed files with 260 additions and 198 deletions.
5 changes: 5 additions & 0 deletions dist/client/manager/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ var ReactProvider = function (_Provider) {
selectedStory: selectedStory
};

// Add the react-perf query string to the iframe if that present.
if (/react_perf/.test(location.search)) {
queryParams['react_perf'] = '1';
}

var queryString = _qs2.default.stringify(queryParams);
var url = 'iframe.html?' + queryString;
return _react2.default.createElement(_preview2.default, { url: url });
Expand Down
5 changes: 5 additions & 0 deletions src/client/manager/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ export default class ReactProvider extends Provider {
selectedStory,
};

// Add the react-perf query string to the iframe if that present.
if (/react_perf/.test(location.search)) {
queryParams['react_perf'] = '1';
}

const queryString = qs.stringify(queryParams);
const url = `iframe.html?${queryString}`;
return (
Expand Down
Loading

0 comments on commit ebce3b8

Please sign in to comment.