Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

catch and log errors thrown when calling React.findDOMNode #82

Merged
merged 2 commits into from
Jun 6, 2019

Conversation

chimericdream
Copy link
Contributor

@chimericdream chimericdream commented Jun 3, 2019

This is mainly a band-aid so that exceptions thrown when checking a DOM node don't crash a React app. It logs the offending component and error to the console.

Given how the library hooks itself into the component lifecycle, I didn't want to try and remove the use of findDOMNode entirely, even though it is deprecated in the newer releases of React/ReactDOM. At a glance, that looks like it will be rather non-trivial to change how react-axe listens for component updates.

Closes issue: #74

Reviewer checks

Required fields, to be filled out by PR reviewer(s)

  • Follows the commit message policy, appropriate for next version
  • Has documentation updated, a DU ticket, or requires no documentation change
  • Includes new tests, or was unnecessary
  • Code is reviewed for security by: Stephen

@CLAassistant
Copy link

CLAassistant commented Jun 3, 2019

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@stephenmathieson stephenmathieson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but let's use console.error() for logging the error.

index.js Outdated Show resolved Hide resolved
@stephenmathieson stephenmathieson merged commit 14eeec6 into dequelabs:develop Jun 6, 2019
@stephenmathieson
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants