react-use/stories/util/NewTabStory.tsx
2021-08-31 22:22:38 +01:00

20 lines
390 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" rel="noreferrer">
opened in a new tab
</a>
.
</p>
);
};
export default NewTabStory;