Skip to content

Commit

Permalink
feat(test): resolve warning message during test
Browse files Browse the repository at this point in the history
  • Loading branch information
yangwooseong committed Jan 11, 2024
1 parent 66923cc commit 2ebfd12
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function RadioGroupImpl<Value extends string>({
direction = 'vertical',
...rest
}: RadioGroupProps<Value>, forwardedRef: React.Ref<HTMLDivElement>) {
const formFieldProps = useFormFieldProps(rest)
const { hasError, ...formFieldProps } = useFormFieldProps(rest)

return (
<RadioGroupPrimitive.Root
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {
type ForwardedRef,
forwardRef,
useEffect,
useMemo,
Expand Down Expand Up @@ -63,7 +64,7 @@ function SegmentedControlItemListImpl<
style,
className,
...rest
}: SegmentedControlItemListProps<Type, Value>) {
}: SegmentedControlItemListProps<Type, Value>, forwardedRef: ForwardedRef<HTMLDivElement>) {
const [selectedItemIndex, setSelectedItemIndex] = useState<number | null>(null)

const {
Expand All @@ -83,6 +84,7 @@ function SegmentedControlItemListImpl<
return (
<SegmentedControlItemList
asChild
ref={forwardedRef}
{...rest}
>
<HStack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const Switch = forwardRef<HTMLButtonElement, SwitchProps>(function Switch
const {
disabled,
required,
hasError,
...ownProps
} = useFormFieldProps(rest)

Expand Down
3 changes: 2 additions & 1 deletion packages/bezier-react/src/features/FeatureProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React, {
} from 'react'

import { createContext } from '~/src/utils/react'
import { isEmpty } from '~/src/utils/type'

import {
type Feature,
Expand Down Expand Up @@ -48,7 +49,7 @@ export function FeatureProvider({
const [featureFlag, setFeatureFlag] = useState<FeatureFlag>(initialFeatureFlag)

useLayoutEffect(function activateFeatures() {
if (!features) {
if (isEmpty(features)) {
return
}

Expand Down

0 comments on commit 2ebfd12

Please sign in to comment.