Download react-use/stories/util/NewTabStory.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 390 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/stories/util/NewTabStory.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-use/stories/util/NewTabStory.tsx
-
curl -L -o NewTabStory.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-use/stories/util/NewTabStory.tsx
390 Bytes
| 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; | |