REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 992 B
Close
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/src/frontend/hoc/with-no-ssr.tsx
Text
Base64
import React, { ComponentType, useEffect, useState } from 'react' /** * A higher-order component that prevents a component from rendering server-side * * @template P - The props object of the wrapped component * @param {React.ComponentType<P>} Component - The component to be wrapped * @returns {React.FC<P>} A new component that renders the given component client-side only */ // eslint-disable-next-line max-len const withNoSSR = <P extends Record<string, unknown>>(Component: ComponentType<P>) => (props: P) => { const [isClient, setIsClient] = useState(false) /** * Sets isClient to true when the component is mounted on the client side */ useEffect(() => { setIsClient(true) }, []) // Renders nothing if the component is not mounted on the client side if (!isClient) return null // Renders the wrapped component with the given props if it's mounted on the client side return <Component {...props} /> } export { withNoSSR as default, withNoSSR, }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
allow-override.tsx
1.23 KB
lrw-r--r--
2026-02-28 00:32:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.ts
102 B
lrw-r--r--
2026-02-28 00:32:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
with-no-ssr.tsx
992 B
lrw-r--r--
2026-02-28 00:32:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
with-notice.ts
1.28 KB
lrw-r--r--
2026-02-28 00:32:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).