GitHub

Isomorphic Hooks

useHydration

Retrieve info about the closest HydrationRoot.

Client / Server


Usage

Retrieve info about the HydrationRoot the component is a child of.

import { useHydration } from '@microeinhundert/radonis'


const hydration = useHydration()


console.log(hydration) // => `{ hydrated: false, id: ':Rl6:' }`

To get more info about the closest HydrationRoot higher up in the tree, use a combination of useManifest and useHydration.

import { useManifest, useHydration } from '@microeinhundert/radonis'


const manifest = useManifest()
const hydration = useHydration()


console.log(manifest.hydration[hydration.id].props) // => `{ someProp: 'test' }`
Previous
Custom Error Pages