Skip to content

Commit

Permalink
Remove optional chain
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Dec 13, 2019
1 parent 5f06152 commit 5eed3ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/a11y/src/addContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ const addContainer = function( ariaLive ) {
container.setAttribute( 'aria-relevant', 'additions text' );
container.setAttribute( 'aria-atomic', 'true' );

// Disable reason: the querySelector + optional chain may make the expression `null`.
// eslint-disable-next-line no-unused-expressions
document.querySelector( 'body' )?.appendChild( container );
const body = document.querySelector( 'body' );
if ( body ) {
body.appendChild( container );
}

return container;
};

Expand Down

0 comments on commit 5eed3ea

Please sign in to comment.