react-html-attributes is a JavaScript utility library that provides a programmatic store of HTML and SVG attributes understood by React, organized by their respective element tags. It includes global attributes accessible via a special '*' key and lists of supported HTML and SVG tags under an 'elements' key. The current stable version is 1.4.6, with the last release occurring in April 2018. This package is no longer actively maintained, meaning its data regarding React-supported attributes and elements is significantly outdated relative to contemporary React versions. While it once offered a direct way to access these lists, modern React development typically relies on explicit JSX attributes and React's internal handling, often making this package's utility superseded for new projects. It differentiates itself by providing a structured, static data set, rather than dynamic introspection or attribute validation.
npm install react-html-attributesVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import the library using CommonJS and access the global HTML attributes and SVG element lists.
Refer to the official React documentation (react.dev) for the most current list of supported DOM attributes and event handlers.
If using in an ESM environment, you must use `require` within a CommonJS module or configure your bundler (like Webpack or Rollup) to correctly handle CJS imports within an ESM project. For Node.js, consider dynamic import `import('react-html-attributes')` or use a CJS wrapper.Avoid using this package for new development. For understanding React's attribute handling, consult the official React documentation directly.
Ensure your file is treated as CommonJS (e.g., `.js` without `"type": "module"` in `package.json` or `.cjs` file extension). Alternatively, if your environment supports it, use dynamic `import('react-html-attributes').then(...)` or refactor your project to handle CJS imports.This package does not have a default export for ES Modules. If you must use it in an ESM context, you might need to use `import * as htmlElementAttributes from 'react-html-attributes';` (which might still require bundler configuration) or stick to `require()` in a CJS context.
No dependency data recorded yet.