Skip to content

Commit

Permalink
fix: 移除 defaultProps (#2230)
Browse files Browse the repository at this point in the history
* fix: 移除 defaultProps

* fix: indent
  • Loading branch information
eiinu committed May 9, 2024
1 parent 99a7310 commit e68ad6e
Show file tree
Hide file tree
Showing 40 changed files with 29 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

exports[`Address: exist defaultIcon & selectIcon 1`] = `"<div class="nut-overlay" style="--nutui-overlay-zIndex: 1000;"></div><div style="z-index: 1000;" class="nut-popup nut-popup-round nut-popup-bottom"><div class="nut-popup-title"><div class="nut-popup-title-title">请选择地址</div><div class="nut-popup-title-right nut-popup-title-right-top-right"><svg class="nut-icon nut-icon-Close " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" aria-labelledby="Close" role="presentation"><path d="M865.83 926.17a42.67 42.67 0 1 0 60.36-60.34L572.35 512l353.84-353.83a42.67 42.67 0 0 0-60.36-60.34L512 451.67 158.19 97.83a42.67 42.67 0 0 0-60.36 60.34L451.67 512 97.83 865.83a42.67 42.67 0 1 0 60.34 60.34L512 572.33z" fill="currentColor" fill-opacity="0.9"></path></svg></div></div><div class="nut-address "><ul class="nut-address-exist"><li class="nut-address-exist-item "><div class="default">123</div><div class="nut-address-exist-item-info"><div>探探鱼</div><div>182****1718</div><div>北京市次渠镇通州区</div></div></li><li class="nut-address-exist-item "><div class="default">123</div><div class="nut-address-exist-item-info"><div>探探鱼</div><div>182****1718</div><div>钓鱼岛钓鱼岛全区</div></div></li><li class="nut-address-exist-item active"><div class="select">456</div><div class="nut-address-exist-item-info"><div>探探鱼</div><div>182****1718</div><div>北京市大兴区科创十一街18号院京东大厦</div></div></li></ul></div></div>"`;

exports[`Address: show custom 1`] = `"<div class="nut-overlay" style="--nutui-overlay-zIndex: 1000;"></div><div style="z-index: 1000;" class="nut-popup nut-popup-round nut-popup-bottom"><div class="nut-popup-title"><div class="nut-popup-title-left"></div><div class="nut-popup-title-title">选择地址</div><div class="nut-popup-title-right nut-popup-title-right-top-right"><svg class="nut-icon nut-icon-Close " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" aria-labelledby="Close" role="presentation"><path d="M865.83 926.17a42.67 42.67 0 1 0 60.36-60.34L572.35 512l353.84-353.83a42.67 42.67 0 0 0-60.36-60.34L512 451.67 158.19 97.83a42.67 42.67 0 0 0-60.36 60.34L451.67 512 97.83 865.83a42.67 42.67 0 1 0 60.34 60.34L512 572.33z" fill="currentColor" fill-opacity="0.9"></path></svg></div></div><div class="nut-cascader "><div class="nut-tabs nut-tabs-horizontal" value="c1"><div class="nut-tabs-titles nut-tabs-titles-line nut-tabs-titles-scrollable"><div class="nut-tabs-titles-item nut-tabs-titles-item-active"><span class="nut-tabs-titles-item-text">请选择</span><span class="nut-tabs-titles-item-line"></span></div></div><div class="nut-tabs-content-wrap"><div class="nut-tabs-content" style="transform: translate3d(-0%, 0, 0); transition-duration: 300ms;"><div class="nut-tabpane active"><div class="nut-cascader-pane"><div class="nut-cascader-item"><div class="nut-cascader-item-title">浙江</div></div><div class="disabled nut-cascader-item"><div class="nut-cascader-item-title">湖南</div></div><div class="nut-cascader-item"><div class="nut-cascader-item-title">福建</div></div></div></div></div></div></div></div></div>"`;
exports[`Address: show custom 1`] = `"<div class="nut-overlay" style="--nutui-overlay-zIndex: 1000;"></div><div style="z-index: 1000;" class="nut-popup nut-popup-round nut-popup-bottom"><div class="nut-popup-title"><div class="nut-popup-title-left"></div><div class="nut-popup-title-title">选择地址</div><div class="nut-popup-title-right nut-popup-title-right-top-right"><svg class="nut-icon nut-icon-Close " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" aria-labelledby="Close" role="presentation"><path d="M865.83 926.17a42.67 42.67 0 1 0 60.36-60.34L572.35 512l353.84-353.83a42.67 42.67 0 0 0-60.36-60.34L512 451.67 158.19 97.83a42.67 42.67 0 0 0-60.36 60.34L451.67 512 97.83 865.83a42.67 42.67 0 1 0 60.34 60.34L512 572.33z" fill="currentColor" fill-opacity="0.9"></path></svg></div></div><div class="nut-cascader "><div class="nut-tabs nut-tabs-horizontal"><div class="nut-tabs-titles nut-tabs-titles-line nut-tabs-titles-scrollable"><div class="nut-tabs-titles-item nut-tabs-titles-item-active"><span class="nut-tabs-titles-item-text">请选择</span><span class="nut-tabs-titles-item-line"></span></div></div><div class="nut-tabs-content-wrap"><div class="nut-tabs-content" style="transform: translate3d(-0%, 0, 0); transition-duration: 300ms;"><div class="nut-tabpane active"><div class="nut-cascader-pane"><div class="nut-cascader-item"><div class="nut-cascader-item-title">浙江</div></div><div class="disabled nut-cascader-item"><div class="nut-cascader-item-title">湖南</div></div><div class="nut-cascader-item"><div class="nut-cascader-item-title">福建</div></div></div></div></div></div></div></div></div>"`;

exports[`Address: show exist 1`] = `"<div class="nut-overlay" style="--nutui-overlay-zIndex: 1000;"></div><div style="z-index: 1000;" class="nut-popup nut-popup-round nut-popup-bottom"><div class="nut-popup-title"><div class="nut-popup-title-title">选择地址</div><div class="nut-popup-title-right nut-popup-title-right-top-right"><svg class="nut-icon nut-icon-Close " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" aria-labelledby="Close" role="presentation"><path d="M865.83 926.17a42.67 42.67 0 1 0 60.36-60.34L572.35 512l353.84-353.83a42.67 42.67 0 0 0-60.36-60.34L512 451.67 158.19 97.83a42.67 42.67 0 0 0-60.36 60.34L451.67 512 97.83 865.83a42.67 42.67 0 1 0 60.34 60.34L512 572.33z" fill="currentColor" fill-opacity="0.9"></path></svg></div></div><div class="nut-address "><ul class="nut-address-exist"><li class="nut-address-exist-item active"><svg class="nut-icon nut-icon-Check " xmlns="http://www.w3.org/2000/svg" color="var(--nutui-color-primary)" viewBox="0 0 1024 1024" aria-labelledby="Check" role="presentation"><path d="M998.4 245.03c-219.43 153.6-398.63 332.8-552.23 552.23-40.23 58.51-128 54.86-164.57-3.66-69.49-106.06-149.94-186.51-256-256-51.2-32.91-18.29-113.37 40.23-98.74 117.03 21.94 208.46 69.49 292.57 146.28 157.26-190.17 358.4-340.11 588.8-435.2 62.17-25.6 106.06 58.51 51.2 95.09" fill="currentColor" fill-opacity="0.9"></path></svg><div class="nut-address-exist-item-info"><div>探探鱼</div><div>182****1718</div><div>北京市次渠镇通州区</div></div></li><li class="nut-address-exist-item "><svg class="nut-icon nut-icon-Location " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" aria-labelledby="Location" role="presentation"><path d="M682.67 470.04c0 94.4-76.42 170.94-170.67 170.94s-170.67-76.54-170.67-170.94S417.75 299.12 512 299.11s170.67 76.52 170.67 170.93m-85.34 0A85.4 85.4 0 0 0 512 384.58c-47.15 0-85.33 38.27-85.33 85.46A85.4 85.4 0 0 0 512 555.5c47.15 0 85.33-38.25 85.33-85.46" fill="currentColor" fill-opacity="0.9"></path>,<path d="M981.33 470.04c0 277.76-312.75 465.73-464.15 552.53a10.22 10.22 0 0 1-10.36 0C355.42 935.79 42.67 747.82 42.67 470.06 42.67 210.45 252.8 0 512 0s469.33 210.45 469.33 470.04m-85.33 0c0-212.39-171.93-384.58-384-384.58S128 257.64 128 470.04c0 106.24 60.52 202.73 151.85 288.85 74.6 70.4 161.98 126.46 232.15 167.89 70.19-41.43 157.55-97.49 232.15-167.89C835.46 672.77 896 576.28 896 470.04" fill="currentColor" fill-opacity="0.9"></path></svg><div class="nut-address-exist-item-info"><div>探探鱼</div><div>182****1718</div><div>钓鱼岛钓鱼岛全区</div></div></li><li class="nut-address-exist-item "><svg class="nut-icon nut-icon-Location " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" aria-labelledby="Location" role="presentation"><path d="M682.67 470.04c0 94.4-76.42 170.94-170.67 170.94s-170.67-76.54-170.67-170.94S417.75 299.12 512 299.11s170.67 76.52 170.67 170.93m-85.34 0A85.4 85.4 0 0 0 512 384.58c-47.15 0-85.33 38.27-85.33 85.46A85.4 85.4 0 0 0 512 555.5c47.15 0 85.33-38.25 85.33-85.46" fill="currentColor" fill-opacity="0.9"></path>,<path d="M981.33 470.04c0 277.76-312.75 465.73-464.15 552.53a10.22 10.22 0 0 1-10.36 0C355.42 935.79 42.67 747.82 42.67 470.06 42.67 210.45 252.8 0 512 0s469.33 210.45 469.33 470.04m-85.33 0c0-212.39-171.93-384.58-384-384.58S128 257.64 128 470.04c0 106.24 60.52 202.73 151.85 288.85 74.6 70.4 161.98 126.46 232.15 167.89 70.19-41.43 157.55-97.49 232.15-167.89C835.46 672.77 896 576.28 896 470.04" fill="currentColor" fill-opacity="0.9"></path></svg><div class="nut-address-exist-item-info"><div>探探鱼</div><div>182****1718</div><div>北京市大兴区科创十一街18号院京东大厦</div></div></li></ul></div></div>"`;
1 change: 0 additions & 1 deletion src/packages/backtop/backtop.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,4 @@ export const BackTop: FunctionComponent<
)
}

BackTop.defaultProps = defaultProps
BackTop.displayName = 'NutBackTop'
1 change: 0 additions & 1 deletion src/packages/backtop/backtop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,4 @@ export const BackTop: FunctionComponent<
)
}

BackTop.defaultProps = defaultProps
BackTop.displayName = 'NutBackTop'
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ exports[`Cascader > change tab 1`] = `
>
<div
class="nut-tabs nut-tabs-horizontal"
value="c1"
>
<div
class="nut-tabs-titles nut-tabs-titles-line nut-tabs-titles-scrollable"
Expand Down Expand Up @@ -98,7 +97,6 @@ exports[`Cascader > change tab 2`] = `
>
<div
class="nut-tabs nut-tabs-horizontal"
value="c1"
>
<div
class="nut-tabs-titles nut-tabs-titles-line nut-tabs-titles-scrollable"
Expand Down Expand Up @@ -189,7 +187,6 @@ exports[`Cascader > visible true 1`] = `
>
<div
class="nut-tabs nut-tabs-horizontal"
value="c3"
>
<div
class="nut-tabs-titles nut-tabs-titles-line nut-tabs-titles-scrollable"
Expand Down
1 change: 0 additions & 1 deletion src/packages/cell/cell.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,5 @@ export const Cell: FunctionComponent<
)
}

Cell.defaultProps = defaultProps
Cell.displayName = 'NutCell'
Cell.Group = CellGroup
1 change: 0 additions & 1 deletion src/packages/cell/cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,5 @@ export const Cell: FunctionComponent<
)
}

Cell.defaultProps = defaultProps
Cell.displayName = 'NutCell'
Cell.Group = CellGroup
1 change: 0 additions & 1 deletion src/packages/cellgroup/cellgroup.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,4 @@ export const CellGroup: FunctionComponent<Partial<CellGroupProps>> = (
)
}

CellGroup.defaultProps = defaultProps
CellGroup.displayName = 'NutCellGroup'
1 change: 0 additions & 1 deletion src/packages/cellgroup/cellgroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,4 @@ export const CellGroup: FunctionComponent<Partial<CellGroupProps>> = (
)
}

CellGroup.defaultProps = defaultProps
CellGroup.displayName = 'NutCellGroup'
1 change: 0 additions & 1 deletion src/packages/col/col.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,4 @@ export const Col: FunctionComponent<
)
}

Col.defaultProps = defaultProps
Col.displayName = 'NutCol'
1 change: 0 additions & 1 deletion src/packages/col/col.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,4 @@ export const Col: FunctionComponent<
)
}

Col.defaultProps = defaultProps
Col.displayName = 'NutCol'
1 change: 0 additions & 1 deletion src/packages/divider/divider.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ export const Divider: FunctionComponent<
)
}

Divider.defaultProps = defaultProps
Divider.displayName = 'NutDivider'
1 change: 0 additions & 1 deletion src/packages/divider/divider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ export const Divider: FunctionComponent<
)
}

Divider.defaultProps = defaultProps
Divider.displayName = 'NutDivider'
1 change: 0 additions & 1 deletion src/packages/elevator/elevator.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,5 @@ export const Elevator: FunctionComponent<
)
}

Elevator.defaultProps = defaultProps
Elevator.displayName = 'NutElevator'
Elevator.Context = elevatorContext
1 change: 0 additions & 1 deletion src/packages/elevator/elevator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,5 @@ export const Elevator: FunctionComponent<
)
}

Elevator.defaultProps = defaultProps
Elevator.displayName = 'NutElevator'
Elevator.Context = elevatorContext
1 change: 0 additions & 1 deletion src/packages/fixednav/fixednav.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,4 @@ export const FixedNav: FunctionComponent<
)
}

FixedNav.defaultProps = defaultProps
FixedNav.displayName = 'NutFixedNav'
1 change: 0 additions & 1 deletion src/packages/fixednav/fixednav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,4 @@ export const FixedNav: FunctionComponent<
)
}

FixedNav.defaultProps = defaultProps
FixedNav.displayName = 'NutFixedNav'
1 change: 0 additions & 1 deletion src/packages/grid/grid.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,5 @@ export const Grid: FunctionComponent<
)
}

Grid.defaultProps = defaultProps
Grid.displayName = 'NutGrid'
Grid.Item = GridItem
1 change: 0 additions & 1 deletion src/packages/grid/grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,5 @@ export const Grid: FunctionComponent<
)
}

Grid.defaultProps = defaultProps
Grid.displayName = 'NutGrid'
Grid.Item = GridItem
1 change: 0 additions & 1 deletion src/packages/griditem/griditem.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,4 @@ export const GridItem: FunctionComponent<
)
}

GridItem.defaultProps = defaultProps
GridItem.displayName = 'NutGridItem'
1 change: 0 additions & 1 deletion src/packages/griditem/griditem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,4 @@ export const GridItem: FunctionComponent<
)
}

GridItem.defaultProps = defaultProps
GridItem.displayName = 'NutGridItem'
1 change: 0 additions & 1 deletion src/packages/image/image.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,4 @@ export const Image: FunctionComponent<Partial<ImageProps>> = (props) => {
)
}

Image.defaultProps = defaultProps
Image.displayName = 'NutImage'
6 changes: 3 additions & 3 deletions src/packages/image/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const Image: FunctionComponent<
error,
loading,
lazy,
draggable,
onClick,
onLoad,
onError,
Expand Down Expand Up @@ -226,7 +227,7 @@ export const Image: FunctionComponent<
loading="lazy"
onLoad={handleLoad}
onError={handleError}
draggable={props.draggable}
draggable={draggable}
/>
) : (
<img
Expand All @@ -237,7 +238,7 @@ export const Image: FunctionComponent<
alt={alt}
onLoad={handleLoad}
onError={handleError}
draggable={props.draggable}
draggable={draggable}
/>
)}
{renderLoading()}
Expand All @@ -246,5 +247,4 @@ export const Image: FunctionComponent<
)
}

Image.defaultProps = defaultProps
Image.displayName = 'NutImage'
1 change: 0 additions & 1 deletion src/packages/navbar/navbar.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,4 @@ export const NavBar: FunctionComponent<Partial<NavBarProps>> = (props) => {
)
}

NavBar.defaultProps = defaultProps
NavBar.displayName = 'NutNavBar'
1 change: 0 additions & 1 deletion src/packages/navbar/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,5 +170,4 @@ export const NavBar: FunctionComponent<Partial<NavBarProps>> = (props) => {
)
}

NavBar.defaultProps = defaultProps
NavBar.displayName = 'NutNavBar'
3 changes: 1 addition & 2 deletions src/packages/overlay/overlay.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const Overlay: FunctionComponent<

const [innerVisible, setInnerVisible] = useState(visible)

const nodeRef = useLockScrollTaro(!!props.lockScroll && innerVisible)
const nodeRef = useLockScrollTaro(!!lockScroll && innerVisible)

useEffect(() => {
if (visible) {
Expand Down Expand Up @@ -110,5 +110,4 @@ export const Overlay: FunctionComponent<
)
}

Overlay.defaultProps = defaultOverlayProps
Overlay.displayName = 'NutOverlay'
3 changes: 1 addition & 2 deletions src/packages/overlay/overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const Overlay: FunctionComponent<
}
}, [visible])

useLockScroll(nodeRef, !!props.lockScroll && innerVisible)
useLockScroll(nodeRef, !!lockScroll && innerVisible)

const classes = classNames(classPrefix, className)

Expand Down Expand Up @@ -117,5 +117,4 @@ export const Overlay: FunctionComponent<
)
}

Overlay.defaultProps = defaultOverlayProps
Overlay.displayName = 'NutOverlay'
1 change: 0 additions & 1 deletion src/packages/row/row.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,4 @@ export const Row: FunctionComponent<
)
}

Row.defaultProps = defaultProps
Row.displayName = 'NutRow'
1 change: 0 additions & 1 deletion src/packages/row/row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,4 @@ export const Row: FunctionComponent<
)
}

Row.defaultProps = defaultProps
Row.displayName = 'NutRow'
2 changes: 2 additions & 0 deletions src/packages/safearea/safearea.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ export const SafeArea: FC<SafeAreaProps> = (props) => {
/>
)
}

SafeArea.displayName = 'NutSafeArea'
2 changes: 2 additions & 0 deletions src/packages/safearea/safearea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ export const SafeArea: FC<SafeAreaProps> = (props) => {
/>
)
}

SafeArea.displayName = 'NutSafeArea'
8 changes: 4 additions & 4 deletions src/packages/sidenavbar/sidenavbar.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ export const SideNavBar: FunctionComponent<Partial<SideNavBarProps>> = (
children,
className,
onClose,
indent,
...rest
} = {
...defaultProps,
...props,
}
const indent = props.indent ? Number(props.indent) : 20
const innerIndent = indent ? Number(indent) : 20
const [sidenavbarShow, setSidenavbarShow] = useState(true)
const handleClick = () => {
setSidenavbarShow(!sidenavbarShow)
Expand All @@ -59,7 +60,7 @@ export const SideNavBar: FunctionComponent<Partial<SideNavBarProps>> = (
>
<div
className={`${classPrefix}-title ${classPrefix}-border-bt`}
style={{ paddingLeft: `${indent}px` }}
style={{ paddingLeft: `${innerIndent}px` }}
>
{title}
<i
Expand All @@ -68,7 +69,7 @@ export const SideNavBar: FunctionComponent<Partial<SideNavBarProps>> = (
}`}
/>
</div>
<OffsetContext.Provider value={indent}>
<OffsetContext.Provider value={innerIndent}>
<div className={`${classPrefix}-content`}>{children}</div>
</OffsetContext.Provider>
</div>
Expand All @@ -78,5 +79,4 @@ export const SideNavBar: FunctionComponent<Partial<SideNavBarProps>> = (
)
}

SideNavBar.defaultProps = defaultProps
SideNavBar.displayName = 'NutSideNavBar'
8 changes: 4 additions & 4 deletions src/packages/sidenavbar/sidenavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ export const SideNavBar: FunctionComponent<Partial<SideNavBarProps>> = (
children,
className,
onClose,
indent,
...rest
} = {
...defaultProps,
...props,
}
const indent = props.indent ? Number(props.indent) : 20
const innerIndent = indent ? Number(indent) : 20

return (
<Popup
Expand All @@ -56,11 +57,11 @@ export const SideNavBar: FunctionComponent<Partial<SideNavBarProps>> = (
>
<div
className={`${classPrefix}-title ${classPrefix}-border-bt`}
style={{ paddingLeft: `${indent}px` }}
style={{ paddingLeft: `${innerIndent}px` }}
>
{title} <i className="arrow-icon arrow-down" />
</div>
<OffsetContext.Provider value={indent}>
<OffsetContext.Provider value={innerIndent}>
<div className={`${classPrefix}-content`}>{children}</div>
</OffsetContext.Provider>
</div>
Expand All @@ -70,5 +71,4 @@ export const SideNavBar: FunctionComponent<Partial<SideNavBarProps>> = (
)
}

SideNavBar.defaultProps = defaultProps
SideNavBar.displayName = 'NutSideNavBar'
1 change: 0 additions & 1 deletion src/packages/space/space.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ export const Space: FunctionComponent<
)
}

Space.defaultProps = defaultProps
Space.displayName = 'NutSpace'
1 change: 0 additions & 1 deletion src/packages/space/space.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ export const Space: FunctionComponent<
)
}

Space.defaultProps = defaultProps
Space.displayName = 'NutSpace'
1 change: 0 additions & 1 deletion src/packages/sticky/sticky.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,4 @@ export const Sticky: FunctionComponent<Partial<StickyProps>> = (props) => {
)
}

Sticky.defaultProps = defaultProps
Sticky.displayName = 'NutSticky'
1 change: 0 additions & 1 deletion src/packages/sticky/sticky.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,4 @@ export const Sticky: FunctionComponent<Partial<StickyProps>> = (props) => {
)
}

Sticky.defaultProps = defaultProps
Sticky.displayName = 'NutSticky'
1 change: 0 additions & 1 deletion src/packages/tabbar/tabbar.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,5 @@ export const Tabbar: FunctionComponent<Partial<TabbarProps>> & {
)
}

Tabbar.defaultProps = defaultProps
Tabbar.displayName = 'NutTabbar'
Tabbar.Item = TabbarItem
1 change: 0 additions & 1 deletion src/packages/tabbar/tabbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,5 @@ export const Tabbar: FunctionComponent<Partial<TabbarProps>> & {
)
}

Tabbar.defaultProps = defaultProps
Tabbar.displayName = 'NutTabbar'
Tabbar.Item = TabbarItem
9 changes: 5 additions & 4 deletions src/packages/tabs/tabs.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export const Tabs: FunctionComponent<Partial<TabsProps>> & {
onChange,
className,
autoHeight,
value: outerValue,
defaultValue: outerDefaultValue,
...rest
} = {
...defaultProps,
Expand All @@ -72,8 +74,8 @@ export const Tabs: FunctionComponent<Partial<TabsProps>> & {
const uuid = useUuid()

const [value, setValue] = usePropsValue<string | number>({
value: props.value,
defaultValue: props.defaultValue,
value: outerValue,
defaultValue: outerDefaultValue,
finalValue: 0,
onChange,
})
Expand Down Expand Up @@ -197,7 +199,7 @@ export const Tabs: FunctionComponent<Partial<TabsProps>> & {
if (!titleRect) return

let to = 0
if (props.direction === 'vertical') {
if (direction === 'vertical') {
const top = titleRects
.slice(0, index)
.reduce((prev: number, curr: RectItem) => prev + curr.height, 0)
Expand Down Expand Up @@ -347,6 +349,5 @@ export const Tabs: FunctionComponent<Partial<TabsProps>> & {
)
}

Tabs.defaultProps = defaultProps
Tabs.displayName = 'NutTabs'
Tabs.TabPane = TabPane

0 comments on commit e68ad6e

Please sign in to comment.