Skip to content

Commit

Permalink
fix: radio type (#2735)
Browse files Browse the repository at this point in the history
  • Loading branch information
oasis-cloud authored Nov 11, 2024
1 parent 371d8ad commit 9f827e2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/packages/radio/radio.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
import classNames, { Mapping } from 'classnames'
import { ITouchEvent, View } from '@tarojs/components'
import RadioContext from '../radiogroup/context'
import RadioGroup from '@/packages/radiogroup/index.taro'
import { BasicComponent, ComponentDefaults } from '@/utils/typings'
import { usePropsValue } from '@/utils/use-props-value'
import { RadioPosition, RadioShape } from '@/packages/radio/types'
Expand Down Expand Up @@ -156,4 +155,3 @@ export const Radio: FC<
}

Radio.displayName = 'NutRadio'
Radio.Group = RadioGroup
2 changes: 0 additions & 2 deletions src/packages/radio/radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { FunctionComponent, MouseEventHandler, useContext } from 'react'
import { CheckChecked, CheckNormal, CheckDisabled } from '@nutui/icons-react'
import classNames from 'classnames'
import RadioContext from '../radiogroup/context'
import RadioGroup from '@/packages/radiogroup'
import { BasicComponent, ComponentDefaults } from '@/utils/typings'
import { usePropsValue } from '@/utils/use-props-value'
import { RadioPosition, RadioShape } from '@/packages/radio/types'
Expand Down Expand Up @@ -149,4 +148,3 @@ export const Radio: FunctionComponent<
}

Radio.displayName = 'NutRadio'
Radio.Group = RadioGroup
8 changes: 2 additions & 6 deletions src/packages/radiogroup/radiogroup.taro.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useCallback } from 'react'
import classNames from 'classnames'
import { View } from '@tarojs/components'
import { ViewProps } from '@tarojs/components/types/View'
import {
RadioGroupDirection,
RadioGroupOption,
Expand Down Expand Up @@ -32,11 +33,7 @@ const defaultProps = {
const classPrefix = 'nut-radiogroup'

export const RadioGroup = React.forwardRef(
(
props: Partial<RadioGroupProps> &
Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>,
ref
) => {
(props: Partial<RadioGroupProps> & Omit<ViewProps, 'onChange'>, ref) => {
const {
children,
className,
Expand All @@ -50,7 +47,6 @@ export const RadioGroup = React.forwardRef(
disabled,
...rest
} = { ...defaultProps, ...props }

const cls = classNames(
classPrefix,
{
Expand Down

0 comments on commit 9f827e2

Please sign in to comment.