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

Always getting this warning: Invalid DOM property class. Did you mean className? #361

Open
molul opened this issue Jan 20, 2023 · 3 comments

Comments

@molul
Copy link

molul commented Jan 20, 2023

This is the code I'm using:

<TextareaAutosize
rows={4}
minRows={4}
class="rounded p-2 bg-stone-700 resize-none border-transparent focus:border-transparent focus:ring-0" {...field} {...props} />

This works perfectly. I can set the colors as I want. However, I'm being told to use className, but if I change class to className on my code, the textarea looses all tailwind styling.

@Andarist
Copy link
Owner

Please always try to share a repro case in a runnable form - either by providing a git repository to clone or a codesandbox. OSS maintainers usually can't afford the time to set up the repro, even if exact steps are given.

@molul
Copy link
Author

molul commented Jan 20, 2023

Please always try to share a repro case in a runnable form - either by providing a git repository to clone or a codesandbox. OSS maintainers usually can't afford the time to set up the repro, even if exact steps are given.

You are right, but my repo is private and I thought this was a very simple issue to check.

I'll try to prepare a repo to show this problem, but I was expecting more something like "oh yes, we're using class and it should be className".

It's weird that tailwind classes are working when using class and not className. Seems like a small slip.

@Andarist
Copy link
Owner

I have no Tailwind experience - but React accepts className and not class. So definitely something is off there but it's unlikely that something is wrong with react-textarea-autosize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants