Skip to content

Commit f3b8679

Browse files
Merge branch 'master' into refactor/device
2 parents 75d955d + cce75e2 commit f3b8679

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/base/src/hooks/usePassThroughHtmlProps.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
const PROP_WHITELIST = /^(aria-|data-|id$|on[A-Z])/;
1+
const PROP_INCLUDELIST = /^(aria-|data-|id$|on[A-Z])/;
22

3-
export const usePassThroughHtmlProps = (props: Record<string, any>, propBlackList: string[] = []) => {
4-
const componentPropBlacklist = new Set(propBlackList);
3+
export const usePassThroughHtmlProps = (props: Record<string, any>, propExcludeList: string[] = []) => {
4+
const componentPropExcludelist = new Set(propExcludeList);
55

66
const returnVal: Record<string, unknown> = {};
77
for (const name in props) {
8-
if (PROP_WHITELIST.test(name) && !componentPropBlacklist.has(name)) {
8+
if (PROP_INCLUDELIST.test(name) && !componentPropExcludelist.has(name)) {
99
returnVal[name] = props[name];
1010
}
1111
}

0 commit comments

Comments
 (0)