Reactstrap: UncontrolledTooltip should not raise an error when the target ID does not exist in the DOM

Created on 25 Jul 2019  ·  3Comments  ·  Source: reactstrap/reactstrap

Issue description

  • reactstrap version ^8.0.0
  • react version ^16.8.6

What is happening?

UncontrolledTooltip (and maybe other Uncontrolled components?) raise an error in the React application when the target ID does not exist in the DOM.

What should be happening?

Instead of raising an error which can make the whole React application crash (imho this does not seem to be a critical problem, but more of an UX one), maybe it should just warn the developer/user through the console and peacefully not show the tooltip.

Steps to reproduce issue

  1. Create an UncontrolledTooltip whose target does not exist in the DOM (or can exist or not in the DOM depending to the component state).

Error message in console

No error in console.

Most helpful comment

+1

Also: https://github.com/reactstrap/reactstrap/issues/773, so sometimes it will crash even if the id is spelled correctly.

I think this should be console.error rather than crashing the whole app.

All 3 comments

Having the same issues with Uncontrolled Tooltips and Badges.

+1

Also: https://github.com/reactstrap/reactstrap/issues/773, so sometimes it will crash even if the id is spelled correctly.

I think this should be console.error rather than crashing the whole app.

Is there any progress on this?

Was this page helpful?
0 / 5 - 0 ratings