From f17bb28223bcce691705959a15342f81ea8ce1fb Mon Sep 17 00:00:00 2001 From: unix Date: Sat, 23 May 2020 08:20:01 +0800 Subject: [PATCH] style(radio): remove unused initial-value --- components/radio/radio-context.ts | 3 +-- components/radio/radio.tsx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/components/radio/radio-context.ts b/components/radio/radio-context.ts index 9a0ecb5..b29271b 100644 --- a/components/radio/radio-context.ts +++ b/components/radio/radio-context.ts @@ -1,7 +1,7 @@ import React from 'react' export interface RadioConfig { - updateState: (value: string) => void + updateState?: (value: string) => void disabledAll: boolean value?: string inGroup: boolean @@ -9,7 +9,6 @@ export interface RadioConfig { const defaultContext = { disabledAll: false, - updateState: () => {}, inGroup: false, } diff --git a/components/radio/radio.tsx b/components/radio/radio.tsx index 8480f5d..b449ad7 100644 --- a/components/radio/radio.tsx +++ b/components/radio/radio.tsx @@ -77,7 +77,7 @@ const Radio: React.FC> = ({ } setSelfChecked(!selfChecked) if (inGroup) { - updateState(radioValue as string) + updateState && updateState(radioValue as string) } onChange && onChange(selfEvent) }