Skip to content

Commit

Permalink
feat(FormLayout): deprecate FormLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
eugpoloz committed Mar 23, 2023
1 parent 2c121f9 commit 12fcb02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions packages/vkui/src/components/FormLayout/FormLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import { classNames } from '@vkontakte/vkjs';
import { warnOnce } from '../../lib/warnOnce';
import { HasComponent, HasRef } from '../../types';
import styles from './FormLayout.module.css';

Expand All @@ -9,7 +10,9 @@ export type FormLayoutProps = React.AllHTMLAttributes<HTMLElement> &
HasRef<HTMLElement> &
HasComponent;

const warn = warnOnce('FormLayout');
/**
* @deprecated since v5.3.0
* @see https://vkcom.github.io/VKUI/#/FormLayout
*/
export const FormLayout = ({
Expand All @@ -20,6 +23,10 @@ export const FormLayout = ({
className,
...restProps
}: FormLayoutProps) => {
if (process.env.NODE_ENV === 'development') {
warn('Компонент устарел и будет удален в v6. Используйте https://vkcom.github.io/VKUI/#/Form');
}

return (
<Component
{...restProps}
Expand Down
2 changes: 1 addition & 1 deletion styleguide/deprecated.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// styleguidist должен парсить @deprecated-компоненты автоматически,
// но почему-то этого не делает. Пока закостылю, потом сделаем как надо
export const deprecated = [];
export const deprecated = ['FormLayout'];

0 comments on commit 12fcb02

Please sign in to comment.