Open onlyling opened 1 year ago
组件默认值配置。
一般情况自定义默认属性。
import React from 'react' import { Provider, Button } from '@fruits-chain/react-native-xiaoshu' const initialValue = { Button: { size: 'm', hairline: true, round: true, }, } const App: React.FC = () => { return ( <Provider initialValue={initialValue}> <Button text="普通按钮" type="primary" /> </Provider> ) }
更深入、高阶替换默认元素,例如 Empty、Result 的图标。
Empty
Result
参考 Blank
const Component = (props) => { const { a = '1', b = '2', ...restProps } = InitialValue.useInitialProps('Component', props) }
目的
使用
一般情况自定义默认属性。
更深入、高阶替换默认元素,例如
Empty
、Result
的图标。适配方式
参考 Blank
已适配组件