geist-ui icon indicating copy to clipboard operation
geist-ui copied to clipboard

Default Props Warning

Open Yash-Singh1 opened this issue 2 years ago • 12 comments
trafficstars

Bug report 🐞

Version & Environment

  • Version of browser: N/A
  • Version of geist-ui/core: 2.3.8

Expected Behaviour

The behavior I expect is no warning

Actual results (or Errors)

I got an error:

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

Additional Context

I think it would be better to switch to JavaScript default parameters instead since defaultProps is deprecated from React in function components.

Yash-Singh1 avatar May 10 '23 01:05 Yash-Singh1

Yeh same, looks like a fairly easy fix, tempted to have a go at it myself but React isn't my primary work although to be fair, nobody is merging PRs at the moment anyway... :/

robinhayward avatar May 12 '23 14:05 robinhayward

I have the same message on a Next.js project...

jercomio avatar May 24 '23 14:05 jercomio

I have the same warnings on Next.js 13

nbuk avatar Aug 09 '23 08:08 nbuk

same warning on Next.js 13. better to go with a different component library?

AlfredMadere avatar Aug 19 '23 21:08 AlfredMadere

Any update on this?

georgeperry1 avatar Mar 05 '24 10:03 georgeperry1

Same here on Next.js 14 - Console errors galore, but at least it works fine?

K-Mistele avatar Mar 25 '24 23:03 K-Mistele

any update on this?

Arnav717 avatar Jun 10 '24 09:06 Arnav717

For now, the workaround I used is to apply the following patch onto the @geist-ui/core package using pnpm: https://github.com/Yash-Singh1/yashsingh.us/blob/f35837df572f58a8a4778aa668eb30687b5d1685/patches/%40geist-ui__core%402.3.8.patch. It changes all function components that rely on defaultProps to instead use default params.

Yash-Singh1 avatar Jun 10 '24 21:06 Yash-Singh1

any update on this?

slarkvan avatar Jul 10 '24 13:07 slarkvan

The error message is flooding my console, what can be done to prevent/remove this?

shreyaskaundinya avatar Aug 06 '24 13:08 shreyaskaundinya

+1

dannyblv avatar Aug 14 '24 06:08 dannyblv

+1

georgeperry1 avatar Aug 18 '24 15:08 georgeperry1