react-html-props
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "react-html-props", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "Justin Mahar <contact@justinmahar.com>", | ||
@@ -26,3 +26,10 @@ "description": "Convenience TypeScript type definitions for all HTML element props.", | ||
}, | ||
"keywords": [], | ||
"keywords": [ | ||
"react", | ||
"html", | ||
"props", | ||
"prop types", | ||
"typescript", | ||
"react html props" | ||
], | ||
"dependencies": {}, | ||
@@ -29,0 +36,0 @@ "peerDependencies": { |
@@ -26,3 +26,3 @@ <h2 align="center"> | ||
- **đŠī¸ Convenience TypeScript HTMLAttributes prop types for all HTML elements** | ||
- Easily reference props for any HTML element with shorthand like `DivProps` instead of `React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>`. | ||
- Easily reference props for any HTML element with shorthand like `DivProps`. | ||
@@ -43,8 +43,6 @@ ## Installation | ||
Use the [object destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#object_destructuring) technique below to unpack `children` from the rest of `div`'s props. | ||
```tsx | ||
import { DivProps } from "react-html-props"; | ||
export const PandaBearComponent = ({ children, ...divProps }: DivProps): JSX.Element => { | ||
export const MyComponent = ({ children, ...divProps }: DivProps): JSX.Element => { | ||
return <div {...divProps}>{children}</div>; | ||
@@ -54,2 +52,4 @@ }; | ||
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 | ||
@@ -56,0 +56,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25879