We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
attributes-to-props
1 parent 1bd1824 commit c9c3b02Copy full SHA for c9c3b02
test/types/lib/attributes-to-props.ts
@@ -0,0 +1,17 @@
1
+import attributesToProps, {
2
+ Attributes,
3
+ Props
4
+} from 'html-react-parser/lib/attributes-to-props';
5
+
6
+let attributes: Attributes = {};
7
8
+attributes = {
9
+ class: 'my-class',
10
+ style: 'color: #bada55; line-height: 42;'
11
+};
12
13
+// $ExpectType Props
14
+const {
15
+ className,
16
+ style: { color, lineHeight }
17
+} = attributesToProps(attributes);
tsconfig.json
@@ -20,6 +20,7 @@
20
"index.d.ts",
21
"lib/dom-to-react.d.ts",
22
"test/types/index.tsx",
23
+ "test/types/lib/attributes-to-props.ts",
24
"test/types/lib/dom-to-react.tsx"
25
]
26
}
0 commit comments