mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-11 03:22:59 +08:00
get data-*, aria-*, and role attributes
This commit is contained in:
parent
77fcbca04d
commit
bcef7ca32e
@ -1,8 +0,0 @@
|
||||
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;
|
||||
}, {});
|
||||
}
|
Loading…
Reference in New Issue
Block a user