Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/addons/Ref/Ref.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ export default class Ref extends Component {

// Heads up! Don't move this condition, it's a short circuit that avoids run of `findDOMNode`
// if `innerRef` isn't passed
// eslint-disable-next-line react/no-find-dom-node
if (innerRef) innerRef(findDOMNode(this))
try {
// eslint-disable-next-line react/no-find-dom-node
if (innerRef) innerRef(findDOMNode(this))
// eslint-disable-next-line no-empty
} catch (_) {}
Copy link
Author

Choose a reason for hiding this comment

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

Silencing the error is horrible and I'm really not happy with this line. There are 2 options: either report it with console.error which will pollute the unit test runs, or only do a try catch in development environment (i.e. check for process.env.NODE_ENV === 'development). What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

@layershifter Given your updates in Stardust, what's your thought here?

Copy link
Member

Choose a reason for hiding this comment

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

I will backport changes from microsoft/fluent-ui-react#491, this will resolve this issue fully 👍

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for addressing this issue.

}

render() {
Expand Down