CCUBE-1916#595
Conversation
| return ( | ||
| <ContextProviders recaptchaSiteKey={props.recaptchaSiteKey}> | ||
| <FrontendEngineInner {...props} ref={ref} /> | ||
| <StyleSheetManager shouldForwardProp={shouldForwardProp}> |
There was a problem hiding this comment.
this won't be a long term fix as we are moving away from styled components
can we find out specifically which components the errors are originating from and target the fixes there?
There was a problem hiding this comment.
a lot more than these are being passed, they likely come from react-hook-form as otherProps in addition to the common schema options in otherSchema
I think there's no choice but to properly omit these props
- for
otherSchema, because most of it is meant to be forwarded to the DS, it should be blacklist-based - we could have a common util to filter out the common schema options - for
otherProps, can help to evaluate if we could destructure specific properties or if a common util is also needed to whitelist/blacklist?
There was a problem hiding this comment.
can this be moved to the utility folder instead?
| import omit from "lodash/omit"; | ||
|
|
||
| const COMMON_SCHEMA_PROP_KEYS = [ | ||
| "children", |
|
|
||
| const COMMON_SCHEMA_PROP_KEYS = [ | ||
| "children", | ||
| "clearBehavior", |
There was a problem hiding this comment.
clearBehavior looks to be specific to filter, should be destructured there directly
| const { error, formattedLabel, id, onChange, schema, value, warning, ...otherProps } = props; | ||
| const { options, validation } = schema; | ||
| const selectProps = filterSchemaProps(schema, ["options"]); |
There was a problem hiding this comment.
drawback is that we are specifying the keys twice
I would propose to split into something like
const { commonSchema: { validation }, customSchema: { options, ...otherSchema } } = filterSchemaProps(schema);

Changes
Bump styled component and fix test warnings
Additional information
fix test warnings for styled component
You may refer to this CCUBE-1916