Registry / serialization / react-property

react-property

JSON →
library2.0.2jsnpmunverified

react-property is a utility package that exposes the internal HTML and SVG DOM property configurations used by React. It provides programmatic access to React's understanding of DOM properties, including their type (e.g., boolean, numeric, string), and a mapping of non-standard attribute names to their standard counterparts (e.g., `accept-charset` to `acceptCharset`). The package is currently stable at version 2.0.2 and appears to have an infrequent release cadence, primarily updating to align with significant changes in React's DOM handling, as seen with its v2.0.0 release. Its key differentiator is providing a direct mirror of React's internal DOM property logic, which can be useful for tools, linting, or custom renderers that need to replicate React's attribute normalization and property handling without relying on the full React DOM package.

npm install react-property
INSTALL
IMPORT
SIG · REACT-PROPERTY
R
react-property
serializationjavascriptv2.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

reactProperty (default export)
import reactProperty from 'react-property';
import { reactProperty } from 'react-property';
The primary export is a default object containing all utilities and constants.
getPropertyInfo
import reactProperty from 'react-property'; const { getPropertyInfo } = reactProperty;
import { getPropertyInfo } from 'react-property';
`getPropertyInfo` is a property of the default export, not a named export directly from the module.
possibleStandardNames
import reactProperty from 'react-property'; const { possibleStandardNames } = reactProperty;
import { possibleStandardNames } from 'react-property';
`possibleStandardNames` is an object property of the default export, not a named export directly.

Demonstrates importing the default export and using its `getPropertyInfo`, `isCustomAttribute`, and `possibleStandardNames` utilities, along with accessing its property type constants.

import reactProperty from 'react-property'; // Get information about a specific HTML property const acceptCharsetInfo = reactProperty.getPropertyInfo('acceptCharset'); console.log('acceptCharset info:', acceptCharsetInfo); // Example: { type: 1, 'alias for': 'accept-charset' } // Check if an attribute is a custom attribute const isDataAttr = reactProperty.isCustomAttribute('data-my-custom-attr'); console.log('Is data-my-custom-attr custom?', isDataAttr); // true // Get standard name for a non-standard attribute const standardName = reactProperty.possibleStandardNames['accept-charset']; console.log('Standard name for accept-charset:', standardName); // acceptCharset // Access property types constants console.log('BOOLEAN property type:', reactProperty.BOOLEAN); console.log('STRING property type:', reactProperty.STRING);
Debug
Known issues
breakingThe 2.0.0 release introduced a breaking change by updating the internal property configuration from React DOM 15 to React DOM 17. This means applications built for older React versions (pre-17) might encounter incorrect property handling or unexpected behavior when upgrading to react-property v2.
fix
Ensure your project's React version is 17 or newer if you are using react-property@2.x. If you require compatibility with React 15/16, you should remain on react-property@1.x.
affects: >=2.0.0
gotchaTypeScript declaration files were only added in version 2.0.2. Prior versions (2.0.0, 2.0.1, and all 1.x versions) do not ship with official TypeScript types. Developers using TypeScript with older versions would need to rely on community-provided types or declare their own.
fix
Upgrade to react-property@2.0.2 or higher for first-party TypeScript support. If sticking to older versions, consider installing `@types/react-property` if available, or create a custom declaration file.
affects: <2.0.2
gotchaThis package mirrors internal React DOM logic. While useful, directly relying on deeply internal structures can be brittle. Future React updates might change these internals, potentially leading to discrepancies or unexpected behavior in `react-property` before it's updated.
fix
Periodically check for updates to `react-property` when upgrading your React version. Consider the stability implications of relying on utilities that expose internal framework mechanisms.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: react_property_1.getPropertyInfo is not a function
Attempting to use `getPropertyInfo` as a named import when it's a property of the default export.
fix
Import the default export and access `getPropertyInfo` from it: `import reactProperty from 'react-property'; const { getPropertyInfo } = reactProperty;`
Property 'getPropertyInfo' does not exist on type 'typeof import("/path/to/node_modules/react-property/index")'.
Using an older version of `react-property` (pre-2.0.2) in a TypeScript project, where official types were not available, or incorrect type declarations are in use.
fix
Upgrade to `react-property@2.0.2` or newer to get official TypeScript types. If an upgrade is not feasible, install community types like `@types/react-property` (if they exist for your version) or create a custom `d.ts` declaration file to assert the module's structure.
Upgrade
Version history
2.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
react-property — npm install react-property · libregistry