Skip to content

Commit

Permalink
feat: Upgrade [email protected]+
Browse files Browse the repository at this point in the history
  • Loading branch information
1uokun committed Nov 14, 2024
1 parent 1d59560 commit ef8c268
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ toc: false

---
### 5.3.0
`2024-11-13`
`2024-11-14`
- 🌟 **Typescript**: export all component props types.
(To support for [nativewind](https://github.com/nativewind/nativewind))
- **Toast**:
Expand All @@ -26,9 +26,14 @@ toc: false
- feat: add `onScrollAnimationEnd` prop
- **Slider**
- feat: add `disabledStep``onSlidingStart``onSlidingComplete``tapToSeek` prop
- fix
- 🔥 Upgrade [email protected]+
- fix: [Switch] `style` props works [#1389](https://github.com/ant-design/ant-design-mobile-rn/issues/1398)
- fix: [Pagination] Remove `flex: 1` to avoid height collapse
- other fix
- fix: [Form] fix Require cycle
- fix: [Tooltip] safe floatingStyles
- fix: [Picker] `defaultValue` prop works [#1311](https://github.com/ant-design/ant-design-mobile-rn/issues/1311)
- fix: [Radio] `defaultChecked` prop works [#1380](https://github.com/ant-design/ant-design-mobile-rn/issues/1380)

### 5.2.3
`2024-09-09`
Expand Down
9 changes: 7 additions & 2 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ toc: false
---

### 5.3.0
`2024-11-13`
`2024-11-14`
- 🌟 **Typescript**: 导出所有 component 的 props types。
(以支持 [nativewind](https://github.com/nativewind/nativewind))
- 🔥 **Toast**:
Expand All @@ -27,9 +27,14 @@ toc: false
- feat: 新增 `onScrollAnimationEnd` 属性
- **Slider**
- feat: 新增 `disabledStep``onSlidingStart``onSlidingComplete``tapToSeek` 属性
- fix
- 🔥 适配 [email protected]+
- fix: [Switch] `style` props works [#1389](https://github.com/ant-design/ant-design-mobile-rn/issues/1398)
- fix: [Pagination] 移除`flex: 1`,避免高度坍塌
- 其他fix
- fix: [Form] fix Require cycle
- fix: [Tooltip] safe floatingStyles
- fix: [Picker] `defaultValue` prop works [#1311](https://github.com/ant-design/ant-design-mobile-rn/issues/1311)
- fix: [Radio] `defaultChecked` prop works [#1380](https://github.com/ant-design/ant-design-mobile-rn/issues/1380)

### 5.2.3
`2024-09-09`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ exports[`renders ./components/pagination/demo/basic.tsx correctly 1`] = `
style={
Array [
Object {
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -266,7 +265,6 @@ exports[`renders ./components/pagination/demo/basic.tsx correctly 1`] = `
style={
Array [
Object {
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -469,7 +467,6 @@ exports[`renders ./components/pagination/demo/basic.tsx correctly 1`] = `
style={
Array [
Object {
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -527,7 +524,6 @@ exports[`renders ./components/pagination/demo/basic.tsx correctly 1`] = `
style={
Array [
Object {
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down
3 changes: 2 additions & 1 deletion components/pagination/style/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export interface PaginationStyle {
export default (theme: Theme) =>
StyleSheet.create<PaginationStyle>({
container: {
flex: 1,
// fix: 高度坍塌 in [email protected]+
// flex: 1,
justifyContent: 'center',
},
numberStyle: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ exports[`renders ./components/provider/demo/basic.tsx correctly 1`] = `
style={
Array [
Object {
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down
22 changes: 9 additions & 13 deletions components/radio/Radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const InternalRadio: React.ForwardRefRenderFunction<
checked,
onChange,
value,
defaultChecked,
disabled = context?.disabled,
...restProps
} = props
Expand All @@ -28,7 +29,7 @@ const InternalRadio: React.ForwardRefRenderFunction<
}

const [innerChecked, setInnerChecked] = useState<boolean | undefined>(
undefined,
checked ?? defaultChecked,
)

const restCheckboxProps = useMemo<RadioProps>(() => {
Expand All @@ -43,19 +44,14 @@ const InternalRadio: React.ForwardRefRenderFunction<
},
}
}
if (checked === undefined) {
return {
checked: innerChecked,
onChange: (e) => {
if (e.target.checked) {
setInnerChecked(true)
}
},
}
}
return {
checked,
onChange,
checked: innerChecked,
onChange: (e) => {
if (e.target.checked && checked === undefined) {
onChange?.(e)
setInnerChecked(true)
}
},
}
}, [checked, context, innerChecked, onChange, value])

Expand Down
2 changes: 0 additions & 2 deletions components/radio/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ exports[`renders ./components/radio/demo/basic.tsx correctly 1`] = `
}
}
accessible={true}
checked={false}
collapsable={false}
focusable={true}
onBlur={[Function]}
Expand Down Expand Up @@ -459,7 +458,6 @@ exports[`renders ./components/radio/demo/basic.tsx correctly 1`] = `
}
}
accessible={true}
checked={false}
collapsable={false}
focusable={true}
onBlur={[Function]}
Expand Down
2 changes: 1 addition & 1 deletion components/slider/slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export function Slider<SliderValue extends SliderValueType>(
onSlidingComplete?.(sliderValue.value, index)
setSliding(false)
},
[onAfterChange, onSlidingComplete, sliderValue.value],
[onAfterChange, onSlidingComplete, sliderValue],
)

// ================= useEffect ======================
Expand Down

0 comments on commit ef8c268

Please sign in to comment.