primer/octicons

[Bug] @primer/octicons-react: defaultProps is deprecated

bates64 opened this issue · 2 comments

defaultProps was recently deprecated in React: see facebook/react#16210.

Using any Octicon produces something like the following warning:

Warning: UploadIcon: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

This is caused by the following code, which needs to be swapped out:

That's right, I'm getting the same error, I think the solution is easy, just use default parameters in the Icon function, something like:

Icon({'aria-label': ariaLabel, tabIndex, className = defaultClassName, fill = 'currentColor', size = 16, verticalAlign = 'text-bottom'})

Or something like that...

Hey @nanaian, this should be fixed in the v17.10.1 release. Closing this for now, but feel free to reopen if you have any other questions.