Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid prop type color supplied to startElement In [Button] #251

Closed
DevYuns opened this issue Feb 27, 2023 · 1 comment
Closed

Invalid prop type color supplied to startElement In [Button] #251

DevYuns opened this issue Feb 27, 2023 · 1 comment
Labels
1️⃣ good first issue Good for newcomers 🍗 enhancement New feature or request

Comments

@DevYuns
Copy link
Contributor

DevYuns commented Feb 27, 2023

Describe the bug
When I add Image component directly into startElement, An error occurred like below.

  Warning: Failed prop type: Invalid props.style key `color` supplied to `Image`.
  Bad object: {
    "color": "#FFF"
  }

I think that cloneElement in this line makes a problem. Since color prop is not supported in <Image/>.

To Reproduce
Steps to reproduce the behavior:

Add <Image/> component directly into startElement in [Button]`

<Button
  startElement={<Image source={IC_MASK} />}
  text={getString('LOGIN')}
/>

Additional context

To fix this problem temporality, Wrap Image component with View.

<Button
  startElement={
    <View>
       <Image source={IC_MASK} />
    </View>
   }
  loading={isLoggingIn}
  text={getString('LOGIN')}
/>
@hyochan hyochan added 1️⃣ good first issue Good for newcomers 🍗 enhancement New feature or request labels Feb 27, 2023
hyochan added a commit that referenced this issue Feb 28, 2023
hyochan added a commit that referenced this issue Feb 28, 2023
React may throw a warning related to issue #251 when undefined style
props are provided to its elements. While this is generally not an issue
in the real world, our customers may be annoyed by the warning message.
In this commit, we have implemented a typeguard to address this issue
when styling cloned elements.

- Resolve#251
@hyochan
Copy link
Member

hyochan commented Feb 28, 2023

Closes #252

@hyochan hyochan closed this as completed Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1️⃣ good first issue Good for newcomers 🍗 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants