get data-*, aria-*, and role attributes

This commit is contained in:
Matt Lein 2018-06-14 09:33:35 -05:00 committed by 偏右
parent 77fcbca04d
commit bcef7ca32e

View File

@ -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;
}, {});
}