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

[1.x] React - Fix potential "undefined" class #271

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

jessarcher
Copy link
Member

Components that destructure the className prop need to specify a default empty string. Otherwise, if the consuming component does not provide a className, the value will be undefined. When the className is cast to a string in the template, JavaScript will insert a literal string "undefined" as a class name.

@taylorotwell taylorotwell merged commit 6b1d0eb into 1.x Mar 8, 2023
@taylorotwell taylorotwell deleted the fix-undefined-class branch March 8, 2023 15:08
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

Successfully merging this pull request may close these issues.

2 participants