New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More →
Socket
Sign inDemoInstall
Socket

react-html-props

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-html-props - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

package.json
{
"name": "react-html-props",
"version": "1.0.3",
"version": "1.0.4",
"author": "Justin Mahar <contact@justinmahar.com>",

@@ -5,0 +5,0 @@ "description": "Convenience TypeScript type definitions for all HTML element props.",

@@ -45,2 +45,16 @@ <h2 align="center">

const MyComponent = (props: DivProps) => {
return <div {...props}>My component</div>;
};
```
### Unpacking Children
We can use [object destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#object_destructuring) to unpack `children` from the rest of an element's props.
Using `div` as an example again:
```tsx
import { DivProps } from "react-html-props";
export const MyComponent = ({ children, ...divProps }: DivProps): JSX.Element => {

@@ -51,4 +65,2 @@ return <div {...divProps}>{children}</div>;

Here we are using [object destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#object_destructuring) to unpack `children` from the rest of `div`'s props.
### Mixing With Custom Props

@@ -55,0 +67,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡ī¸ by Socket Inc