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

Annoying warnings because of props littering #596

Open
EmilRais opened this issue Jan 10, 2023 · 1 comment
Open

Annoying warnings because of props littering #596

EmilRais opened this issue Jan 10, 2023 · 1 comment
Labels

Comments

@EmilRais
Copy link

What is the problem?

It's super annoying that the following file:
https://github.com/JesperLekland/react-native-svg-charts/blob/dev/src/animated-path.js

Passes its props, unfiltered, to "react-native-svg"'s Path so that the props end up in the dom.
That triggers 3 super large warnings in the console on web based browsers.
One for "animate", "animationDuration", and "renderPlaceholder".

It's easy to fix, just do the following:

const { animate, animationDuration, renderPlaceholder, ...otherProps } = this.props;

return (
    <Path
        ref={(ref) => (this.component = ref)}
        {...otherProps}
        d={this.props.animate ? this.state.d : this.props.d}
    />
);
@EmilRais EmilRais added the bug label Jan 10, 2023
@brduck
Copy link

brduck commented Apr 28, 2023

Same error here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants