{"id":11831,"library":"react-property","title":"React DOM Property Configuration","description":"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.","status":"active","version":"2.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/remarkablemark/react-dom-core","tags":["javascript","react-property","html","svg","dom","property","attribute","config","react","typescript"],"install":[{"cmd":"npm install react-property","lang":"bash","label":"npm"},{"cmd":"yarn add react-property","lang":"bash","label":"yarn"},{"cmd":"pnpm add react-property","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The primary export is a default object containing all utilities and constants.","wrong":"import { reactProperty } from 'react-property';","symbol":"reactProperty (default export)","correct":"import reactProperty from 'react-property';"},{"note":"`getPropertyInfo` is a property of the default export, not a named export directly from the module.","wrong":"import { getPropertyInfo } from 'react-property';","symbol":"getPropertyInfo","correct":"import reactProperty from 'react-property';\nconst { getPropertyInfo } = reactProperty;"},{"note":"`possibleStandardNames` is an object property of the default export, not a named export directly.","wrong":"import { possibleStandardNames } from 'react-property';","symbol":"possibleStandardNames","correct":"import reactProperty from 'react-property';\nconst { possibleStandardNames } = reactProperty;"}],"quickstart":{"code":"import reactProperty from 'react-property';\n\n// Get information about a specific HTML property\nconst acceptCharsetInfo = reactProperty.getPropertyInfo('acceptCharset');\nconsole.log('acceptCharset info:', acceptCharsetInfo); // Example: { type: 1, 'alias for': 'accept-charset' }\n\n// Check if an attribute is a custom attribute\nconst isDataAttr = reactProperty.isCustomAttribute('data-my-custom-attr');\nconsole.log('Is data-my-custom-attr custom?', isDataAttr); // true\n\n// Get standard name for a non-standard attribute\nconst standardName = reactProperty.possibleStandardNames['accept-charset'];\nconsole.log('Standard name for accept-charset:', standardName); // acceptCharset\n\n// Access property types constants\nconsole.log('BOOLEAN property type:', reactProperty.BOOLEAN);\nconsole.log('STRING property type:', reactProperty.STRING);\n","lang":"typescript","description":"Demonstrates importing the default export and using its `getPropertyInfo`, `isCustomAttribute`, and `possibleStandardNames` utilities, along with accessing its property type constants."},"warnings":[{"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.","message":"The 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.","severity":"breaking","affected_versions":">=2.0.0"},{"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.","message":"TypeScript 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.","severity":"gotcha","affected_versions":"<2.0.2"},{"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.","message":"This 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.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Import the default export and access `getPropertyInfo` from it: `import reactProperty from 'react-property'; const { getPropertyInfo } = reactProperty;`","cause":"Attempting to use `getPropertyInfo` as a named import when it's a property of the default export.","error":"TypeError: react_property_1.getPropertyInfo is not a function"},{"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.","cause":"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.","error":"Property 'getPropertyInfo' does not exist on type 'typeof import(\"/path/to/node_modules/react-property/index\")'."}],"ecosystem":"npm"}