react-use/stories/util/NewTabStory.tsx
Anton Zinovyev 2832b7a37e
chore: move all stories from src directory. (#715)
chore: clean tsconfig.json;

feat: updated webpack config to export a function to achieve full-control mode, instead of deprecated Extend Mode;
2019-12-09 23:36:40 +03:00

20 lines
373 B
TypeScript

import * as React from 'react';
const NewTabStory = ({ children }) => {
if (window.location === window.parent.location) {
return children;
}
return (
<p>
This story should be{' '}
<a href={window.location.href} target="_blank" title="Open in new tab">
opened in a new tab
</a>
.
</p>
);
};
export default NewTabStory;