mirror of
https://github.com/streamich/react-use.git
synced 2026-02-01 14:37:31 +00:00
20 lines
390 B
TypeScript
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;
|