Skip to content

CCUBE-1916#595

Open
benjaminLeongSK wants to merge 2 commits into
mainfrom
BL/1916
Open

CCUBE-1916#595
benjaminLeongSK wants to merge 2 commits into
mainfrom
BL/1916

Conversation

@benjaminLeongSK
Copy link
Copy Markdown
Contributor

Changes
Bump styled component and fix test warnings

  • [delete] branch

Additional information

  • fix test warnings for styled component

  • You may refer to this CCUBE-1916

@benjaminLeongSK benjaminLeongSK self-assigned this May 9, 2026
return (
<ContextProviders recaptchaSiteKey={props.recaptchaSiteKey}>
<FrontendEngineInner {...props} ref={ref} />
<StyleSheetManager shouldForwardProp={shouldForwardProp}>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

@benjaminLeongSK benjaminLeongSK May 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2026-05-11 at 4 12 06 PM

i see, we technically can target the fixes. its mainly caused by passing in extra props into styled button components (eg submit button). we can get around it by omitting out those props and it clears the warnings. what do you think

Copy link
Copy Markdown
Contributor

@qroll qroll May 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Screenshot 2026-05-13 at 8 59 49 AM

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be moved to the utility folder instead?

import omit from "lodash/omit";

const COMMON_SCHEMA_PROP_KEYS = [
"children",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why children?


const COMMON_SCHEMA_PROP_KEYS = [
"children",
"clearBehavior",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clearBehavior looks to be specific to filter, should be destructured there directly

Comment on lines +17 to +19
const { error, formattedLabel, id, onChange, schema, value, warning, ...otherProps } = props;
const { options, validation } = schema;
const selectProps = filterSchemaProps(schema, ["options"]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants