Skip to content

Error on className with React 19 #560

Closed
@Arkellys

Description

Describe the bug

On React 19 (beta), an error is thrown if className is not passed to <FontAwesomeIcon>.
I believe it's the same bug as the one reported on this issue, except that now it happens even when no className is specified.

Reproducible test case

https://codesandbox.io/p/sandbox/react-19-font-awesome-k6n8ww?file=%2Fsrc%2FApp.js%3A11%2C51

Error on the sandbox:

TypeError: className is undefined

I get a different error when I try it on my app (maybe it depends on the bundler config):

Uncaught TypeError: Cannot read properties of undefined (reading 'split')

Expected behavior

The error is fixed when adding a className, but this prop should not be required.

Setup

  • Browsers: Firefox (125.0.3), Electron (Chromium M124)
  • Font Awesome 6.5.2
  • react-fontawesome 0.2.0
  • React 19.0.0-beta-6946ebe620-20240508

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions