Browse Source

pass data-* aria-* and role props

pull/11060/head
Matt Lein 7 years ago
committed by 偏右
parent
commit
77fcbca04d
  1. 8
      components/_util/getDataAttributes.ts
  2. 2
      package.json

8
components/_util/getDataAttributes.ts

@ -0,0 +1,8 @@
export default function getDataAttributes(props: any) {
return Object.keys(props).reduce((prev: any, key: string) => {
if (key.substr(0, 5) === 'data-') {
prev[key] = props[key];
}
return prev;
}, {});
}

2
package.json

@ -83,6 +83,7 @@
"react-lifecycles-compat": "^3.0.4",
"react-slick": "~0.23.1",
"shallowequal": "^1.0.1",
"tslint": "^5.10.0",
"warning": "~4.0.1"
},
"devDependencies": {
@ -168,6 +169,7 @@
"scrollama": "^1.4.1",
"stylelint": "9.3.0",
"stylelint-config-standard": "^18.0.0",
"ts-jest": "^22.4.6",
"typescript": "~2.9.1",
"unified": "^7.0.0",
"values.js": "^1.0.3",

Loading…
Cancel
Save