Closed TSRohit99 closed 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.
You can refer to this blog - https://sophiabits.com/blog/stop-using-defaultprops
Could you try if your reported issue is resolved with 2.1.0
?
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
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.
I can now confirm that 2.1.1
solved the issue. Thanks @stanleyxu2005 your help is much appreciated
Issue has be confirmed resolved in v2.1.1
. Close the issue now.
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.