Skip to content

Commit

Permalink
Only run useContext on web
Browse files Browse the repository at this point in the history
  • Loading branch information
Glen Davies committed Jan 27, 2022
1 parent 6c28711 commit 8ab1544
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/block-library/src/gallery/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ function GalleryEdit( props ) {
};
}, [] );

const styleElement = useContext( BlockList.__unstableElementContext );
const styleElement = Platform.isWeb
? // eslint-disable-next-line react-hooks/rules-of-hooks
useContext( BlockList.__unstableElementContext )
: undefined;

const innerBlockImages = useSelect(
( select ) => {
Expand Down

0 comments on commit 8ab1544

Please sign in to comment.