@phamquyen/rn-core-components
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

@phamquyen/rn-core-components

Basic some regular compoents in usually using in proeject

Installation

npm install @phamquyen/rn-core-components

hoặc

yarn add @phamquyen/rn-core-components

Usage

// ---- using Tab Component ------
import {
  ITabView,
  ITabBarItem,
  ITabItemProps,
  TabModel,
} from "@phamquyen/rn-core-components";

// ...
const App = (second) => {
  const [index, setIndex] = React.useState < number > 0;
  const routes: Array<TabModel> = [];

  const renderTabIcon = (props: ITabItemProps) => {
    return <ITabBarItem {...props} />;
  };

  const renderScene = React.useCallback(({ tab }: { tab: TabModel }) => {
    switch (tab.key) {
      case "Button":
        return <ButtonTab />;
      default:
        return <></>;
    }
  }, []);

  return (
    <ITabView
      onIndexChange={setIndex}
      renderScene={renderScene}
      navigationState={{ index, routes }}
      renderTabIcon={renderTabIcon} // ---- custom ItemTabbar
      // disableSwipe       // ----- disable Swipe tab
      isFixed // ----- styles Fixed tabbar
    />
  );
};

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Package Sidebar

Install

npm i @phamquyen/rn-core-components

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

751 kB

Total Files

474

Last publish

Collaborators

  • phamquyen