stanleyxu2005 / react-checkmark

Animated checkmark for React
Apache License 2.0
29 stars 5 forks source link

defaultProps issue! #16

Closed TSRohit99 closed 3 months ago

TSRohit99 commented 3 months ago

Hey, in the upcoming major releases on reactjs "defaultProps" will be removed (as per the error on console I encountered while using your checkmark svg), you may want to update this part :

Checkmark.defaultProps = { size: 'large', };

to fix this issue. I could not use it in my project due to the error and it slows down the whole nextjs application(on initial rendering it gets an server error due to this). Thanks.

stanleyxu2005 commented 3 months ago

I'm not actively working on React projects. Could you share me the link regarding deprecation of defaultProps? I'm not sure if propTypes still allowed in mainstream React versions.

TSRohit99 commented 3 months ago

You can refer to this blog - https://sophiabits.com/blog/stop-using-defaultprops

stanleyxu2005 commented 3 months ago

Could you try if your reported issue is resolved with 2.1.0?

trojaond commented 3 months ago

I am also receiving the error: Warning: a2: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead and I am running on version 2.1.0

stanleyxu2005 commented 3 months ago

I might have published the package with wrong build content. I have now re-published as 2.1.1. This time I removed the prop-types package completely. If defaultProps warning comes again, I will be very surprised.

trojaond commented 3 months ago

I can now confirm that 2.1.1 solved the issue. Thanks @stanleyxu2005 your help is much appreciated

stanleyxu2005 commented 3 months ago

Issue has be confirmed resolved in v2.1.1. Close the issue now.