0.0.10 • Published 7 months ago

@ray-js/components-ty-config-provider v0.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

English | 简体中文

@ray-js/components-ty-config-provider

latest download

Config Provider.

Installation

$ npm install @ray-js/components-ty-config-provider
# or
$ yarn add @ray-js/components-ty-config-provider

Usage

import ConfigProvider, { useConfig } from '@ray-js/components-ty-config-provider';

const Button = () => {
  const config = useConfig();
  return <View style={{ background: config?.global?.background }}>Click</View>;
};

export default () => (
  <ConfigProvider config={{ global: { background: 'blue' } }}>
    <Button />
  </ConfigProvider>
);