@reaxis/_preact-internals v0.0.2
@reaxis/_preact-internals
Exports minified property names used by preact/preact-render-to-string as constants, as well as types for InternalVNode and InternalOptions which include the full set of properties available on those objects.
This package also exports a reference to the VNode that's currently being rendered by Preact, which is updated through attaching a _diff hook (also a Preact internal).
Preact internals might change and this is a third-party library, use at your own risk! From the Preact documentation:
Option Hooks are shipped in Preact, and as such are semantically versioned. However, they do not have the same deprecation policy, which means major versions can change the API without an extended announcement period leading up to release. This is also true for the structure of internal APIs exposed through Options Hooks, like VNode objects.
Exports
import { currentNode } from "@reaxis/_preact-internals";
// during a render
console.log(currentNode) // type: InternalVNodeLook at the source for the other exports.
Changelog
0.0.2 (January 19, 2025)
- currentNode is now always updated when the library is loaded, and gets set to
nullin thediffedhook, which happens right after the component is finished rendering.
0.0.1 (January 18, 2025)
- Initial release