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

[BUG] - Input problems #582

Closed
andresflorez16 opened this issue Jun 29, 2022 · 17 comments
Closed

[BUG] - Input problems #582

andresflorez16 opened this issue Jun 29, 2022 · 17 comments
Labels
🐛 Type: Bug Something isn't working

Comments

@andresflorez16
Copy link

Describe the bug

I tried to use the Input with id, type attributes, but I got the same error

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Import Input
  2. Add Attributs to my Input
  3. Console Error

Expected behavior

As I user, I expect no got Console Error

Screenshots or Videos

Screenshot_1
Screenshot_2

Operating System Version

  • OS: [Windows]

Browser

Chrome

@andresflorez16 andresflorez16 added the 🐛 Type: Bug Something isn't working label Jun 29, 2022
@andresflorez16 andresflorez16 changed the title [BUG] - Input probles [BUG] - Input problems Jun 29, 2022
@danielsimao
Copy link
Contributor

danielsimao commented Jun 29, 2022

@andresflorez16, did you setup correctly the library? You need to wrapper your app around NextUIProvider as it is explained in the Getting Started.

This erros occurs because the library react-aria generates unique ids and needs a their specific provider wrapper around the app, so they can generate the same id both on the server side and the client side.

@andresflorez16
Copy link
Author

Hi, thanks for your prompt response, I use the provider:
image
image

@danielsimao
Copy link
Contributor

Could you please create a codesandbox?

@andresflorez16
Copy link
Author

This is the repository, https://github.com/andresflorez16/ladrillos-mocoa.git

@danielsimao
Copy link
Contributor

I don't see anything abnormal in your repo that would cause the warning. I might have to look up into the input's label.

@andresflorez16
Copy link
Author

Everything it's fine, idk what it could be

@danielsimao
Copy link
Contributor

Can this be closed then?

@andresflorez16
Copy link
Author

Ok close it, but the bug is still there, so I'll keep an eye on it

@tpruisimao
Copy link

Sorry, I misundertood. I thought you said the warning was gone.

@andresflorez16
Copy link
Author

Oh no, sorry, the warning is still there, I mean, idk what it's, my code it's fine... 😅

@Tossko
Copy link

Tossko commented Jun 29, 2022

I have the same error as @andresflorez16, i have the provider configured according to the official documentation.

image

@danielsimao
Copy link
Contributor

danielsimao commented Jun 30, 2022

I just found why: React Spectrum Issue.

NextUI is still running on react version 16.8.0. To fix this issue on the lib side we would need to:

  • Update React version to >=18.0.0
  • Update @react-aria version that includes support for React version >= 18.0.0

For the time being, if you want to ignore the issue you will have to run your app without Strict Mode. Here is how:

next.config.js

/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: false,
};

module.exports = nextConfig;

link to docs

@andresflorez16
Copy link
Author

`/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
};

module.exports = nextConfig;`

That's works for me, thanks.

@danielsimao
Copy link
Contributor

danielsimao commented Jun 30, 2022

This ticket can be closed now, but here are some necessary actions for future @jrgarciadev:

  1. Upgrade current React version to 18.0.0
  2. Update @react-aria that supports react 18.0.0

@andresflorez16
Copy link
Author

My versions are > 18.0.0 btw

@danielsimao
Copy link
Contributor

danielsimao commented Jun 30, 2022

Yes, but the problem comes from react-aria which is a dependency package of the project. The currently installed version most likely does not have react in version 18.0.0.

@jrgarciadev
Copy link
Member

Hey @danielsimao thank you for finding a solution, this is because react-aria doesn't support the strict mode of React 18 yet adobe/react-spectrum#3108, Strict mode support will be done separately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants