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

Bootstrap 5 ToastHeader: charCode warning #2338

Closed
krnlde opened this issue Oct 15, 2021 · 0 comments · May be fixed by #2788
Closed

Bootstrap 5 ToastHeader: charCode warning #2338

krnlde opened this issue Oct 15, 2021 · 0 comments · May be fixed by #2788

Comments

@krnlde
Copy link
Contributor

krnlde commented Oct 15, 2021

  • components: Toast
  • reactstrap version #9.0.0-7
  • import method yarn start
  • react version >=16.8.0
  • bootstrap version ^5.1.3

What is happening?

Including Reacstrap Toasts will immediately throw an Error into the browser console stating: React does not recognize the charCode prop on a DOM element

What should be happening?

Steps to reproduce issue

  1. clone this repo
  2. npm install
  3. npm start
  4. open browser console
  5. Navigate to "Toast" in storybook
  6. profit

Error message in console

react-dom.development.js:88 
        
Warning: React does not recognize the `charCode` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `charcode` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
    in div (created by ToastHeader)
    in ToastHeader
    in div (created by Transition)
    in Transition (created by Fade)
    in Fade (created by Toast)
    in Toast
    in div
    in div
    in Unknown (created by InlineStory)
    in InlineStory (created by Story)
    in Story (created by Context.Consumer)
    in MDXProvider (created by Context.Consumer)
    in div (created by Context.Consumer)
    in Story (created by DocsStory)
    in div (created by Preview)
    in div (created by ZoomElement)
    in div (created by Context.Consumer)
    in Styled(div) (created by ZoomElement)
    in ZoomElement (created by Preview)
    in div (created by Context.Consumer)
    in Styled(div) (created by Preview)
    in div (created by Context.Consumer)
    in Styled(div) (created by Preview)
    in div (created by Context.Consumer)
    in Styled(div) (created by Preview)
    in Preview (created by Canvas)
    in MDXProvider (created by Canvas)
    in Canvas (created by DocsStory)
    in div (created by Anchor)
    in Anchor (created by DocsStory)
    in DocsStory (created by Primary)
    in Primary (created by DocsPage)
    in DocsPage
    in div (created by Context.Consumer)
    in Styled(div) (created by DocsContainer)
    in div (created by Context.Consumer)
    in Styled(div) (created by DocsContainer)
    in MDXProvider (created by DocsContainer)
    in ThemeProvider (created by DocsContainer)
    in SourceContainer (created by DocsContainer)
    in DocsContainer

Code

const defaultProps = {
  tag: 'strong',
  wrapTag: 'div',
  tagClassName: 'me-auto',
  closeAriaLabel: 'Close',
  charCode: 215,
};

See here https://github.com/krnlde/reactstrap/blob/bootstrap5/src/ToastHeader.js#L24

P.S.: Since it's hacktoberfest I'll produce a PR for this.

krnlde pushed a commit to krnlde/reactstrap that referenced this issue Oct 15, 2021
phwebi pushed a commit that referenced this issue Oct 26, 2021
Fixes #2338

Co-authored-by: Kai Dorschner <me@krnl.de>
@phwebi phwebi closed this as completed Oct 27, 2021
phwebi pushed a commit that referenced this issue Oct 27, 2021
Fixes #2338

Co-authored-by: Kai Dorschner <me@krnl.de>
phwebi pushed a commit that referenced this issue Oct 27, 2021
Fixes #2338

Co-authored-by: Kai Dorschner <me@krnl.de>
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 a pull request may close this issue.

2 participants