react-code-dataset / react-page /docs /examples /slate-plugin-src /components /ConditionalWrapper.tsx
Download react-page/docs/examples/slate-plugin-src/components/ConditionalWrapper.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 289 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-page/docs/examples/slate-plugin-src/components/ConditionalWrapper.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-page/docs/examples/slate-plugin-src/components/ConditionalWrapper.tsx
-
curl -L -o ConditionalWrapper.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-page/docs/examples/slate-plugin-src/components/ConditionalWrapper.tsx
289 Bytes
| import React from 'react'; | |
| export const ConditionalWrapper: React.FC<{ | |
| condition: boolean; | |
| children: React.ReactElement; | |
| wrapper: (children: React.ReactElement) => React.ReactElement; | |
| }> = ({ condition, wrapper, children }) => ( | |
| <>{condition ? wrapper(children) : children}</> | |
| ); | |