Skip to content

Commit

Permalink
refactor: remove null since ReactNode unions it already
Browse files Browse the repository at this point in the history
  • Loading branch information
wingkwong committed Jan 13, 2025
1 parent 00a3a8a commit 61756cb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/docs/content/docs/components/navbar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ When the `NavbarItem` is active, it will have a `data-active` attribute. You can
data={[
{
attribute: "icon",
type: "ReactNode | ((isOpen: boolean | undefined) => ReactNode | null)",
type: "ReactNode | ((isOpen: boolean | undefined) => ReactNode)",
description: "The icon to render as the navbar menu toggle.",
default: "-"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/components/accordion/src/accordion-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const AccordionItem = forwardRef<"button", AccordionItemProps>((props, ref) => {

const willChange = useWillChange();

const indicatorContent = useMemo<ReactNode | null>(() => {
const indicatorContent = useMemo<ReactNode>(() => {
if (typeof indicator === "function") {
return indicator({indicator: <ChevronIcon />, isOpen, isDisabled});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/components/listbox/src/listbox-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const ListboxItem = (props: ListboxItemProps) => {
getSelectedIconProps,
} = useListboxItem(props);

const selectedContent = useMemo<ReactNode | null>(() => {
const selectedContent = useMemo<ReactNode>(() => {
const defaultIcon = (
<ListboxSelectedIcon disableAnimation={disableAnimation} isSelected={isSelected} />
);
Expand Down
2 changes: 1 addition & 1 deletion packages/components/menu/src/menu-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const MenuItem = (props: MenuItemProps) => {
getSelectedIconProps,
} = useMenuItem(props);

const selectedContent = useMemo<ReactNode | null>(() => {
const selectedContent = useMemo<ReactNode>(() => {
const defaultIcon = (
<MenuSelectedIcon disableAnimation={disableAnimation} isSelected={isSelected} />
);
Expand Down
4 changes: 2 additions & 2 deletions packages/components/tabs/src/base/tab-item-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ interface Props<T extends object = {}> extends Omit<ItemProps<"button", T>, "chi
/**
* The content of the component.
*/
children?: ReactNode | null;
children?: ReactNode;
/**
* The title of the component.
*/
title?: ReactNode | null;
title?: ReactNode;
/**
* A string representation of the item's contents. Use this when the title is not readable.
* This will be used as native `title` attribute.
Expand Down

0 comments on commit 61756cb

Please sign in to comment.