Skip to content

Commit

Permalink
fix move deprecation warning into component body to ensure it only ou…
Browse files Browse the repository at this point in the history
…tputs when used
  • Loading branch information
fabiankaegy committed Jul 19, 2023
1 parent 6cec6c1 commit 268d1a9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions components/inner-block-slider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ import PropTypes from 'prop-types';
import { jsx, css } from '@emotion/react';
import { ChevronLeft, ChevronRight } from './icons';

deprecated('InnerBlockSlider', {
since: '1.15.12',
version: '1.16',
alternative:
'the useInnerBlocksProps hook to render the inner blocks and then use the same JS library that powers the slider on the frontend in the editor',
plugin: '10up Block Components',
});

const InnerBlockSlider = ({
parentBlockId,
slidesPerPage,
Expand All @@ -26,6 +18,14 @@ const InnerBlockSlider = ({
}) => {
const [currentPage, setCurrentPage] = useState(1);

deprecated('InnerBlockSlider', {
since: '1.15.12',
version: '1.16',
alternative:
'the useInnerBlocksProps hook to render the inner blocks and then use the same JS library that powers the slider on the frontend in the editor',
plugin: '10up Block Components',
});

let innerBlockTemplate = template;

if (!innerBlockTemplate) {
Expand Down

0 comments on commit 268d1a9

Please sign in to comment.