Skip to content

Commit

Permalink
feat: remove need tranform
Browse files Browse the repository at this point in the history
  • Loading branch information
answershuto committed Sep 14, 2024
1 parent d9ac053 commit fd659b5
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions packages/rax-compat/src/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,12 @@ function transformProps(type: string, props: ComponentProps<JSXElementConstructo
}
// eslint-disable-next-line no-prototype-builtins
} else {
const needTransform = (type !== 'svg');
if (needTransform) {
if (Object.prototype.hasOwnProperty.call(possibleStandardNames, lowerCasedPropKey)) {
// Transform attribute names that make it works properly in React.
key = possibleStandardNames[lowerCasedPropKey];
} else {
// Handles component props from rax-components like resizeMode, this causes React to throw a warning.
key = lowerCasedPropKey;
}
if (Object.prototype.hasOwnProperty.call(possibleStandardNames, lowerCasedPropKey)) {
// Transform attribute names that make it works properly in React.
key = possibleStandardNames[lowerCasedPropKey];
} else {
// Handles component props from rax-components like resizeMode, this causes React to throw a warning.
key = lowerCasedPropKey;
}
}

Expand Down

0 comments on commit fd659b5

Please sign in to comment.