Skip to content

Commit

Permalink
Types/FormItem (carbon-design-system#14899)
Browse files Browse the repository at this point in the history
* refactor: migrate to ts

* Update packages/react/src/components/FormItem/FormItem.tsx

Co-authored-by: Guilherme Datilio Ribeiro <guilhermedatilio@gmail.com>

* Update packages/react/src/components/FormItem/FormItem.tsx

Co-authored-by: Guilherme Datilio Ribeiro <guilhermedatilio@gmail.com>

---------

Co-authored-by: Guilherme Datilio Ribeiro <guilhermedatilio@gmail.com>
Co-authored-by: Taylor Jones <tay1orjones@users.noreply.github.com>
  • Loading branch information
3 people committed Oct 18, 2023
1 parent 86781db commit adcc90f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@ import React from 'react';
import classnames from 'classnames';
import { usePrefix } from '../../internal/usePrefix';

function FormItem({ className, children, ...rest }) {
type FormItemProps = {
/**
* Provide content to be rendered in the form item
*/
children?: React.ReactNode;

/**
* Provide a custom className to be applied to the containing node
*/
className?: string;
};

function FormItem({ className, children, ...rest }: FormItemProps) {
const prefix = usePrefix();
const classNames = classnames(`${prefix}--form-item`, className);

Expand Down

0 comments on commit adcc90f

Please sign in to comment.