Giter Site home page Giter Site logo

abinzhao / sciopro Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 23.74 MB

🪐 通过monorepo搭建多包仓库,其中包括react组件库,hooks库以及工具函数库

Home Page: https://abinzhao.github.io/scioPro/

License: MIT License

JavaScript 93.37% TypeScript 4.18% HTML 2.21% Less 0.22% Shell 0.01% CSS 0.01%
hooks utils sciopro ui-components

sciopro's Introduction

scioPro

A lightweight React toolchain built through Monorepo multi-package repository, including react component library, hooks library and tool function library
stars react licence

English | 简体中文

加入开发

# Pull repository code
git clone https://github.com/abinzhao/scioPro.git

# Enter the branch and install the dependencies
cd ./scioPro
yarn install

# Create new branch from master branch and enter, start developing

git checkout -b sciopro/[Semantic name]
# such as:git checkout -b sciopro/dev-button

🖥 Browser Compatibility

edge Edge chrome safari electron_48x48
Edge last 2 versions last 2 versions last 2 versions last 2 versions

On-demand loading/TypeScript

@sciopro/components@sciopro/hooks,@sciopro/utils The JS code supports tree shaking based on ES modules by default, and is written in TypeScript and provides a complete definition file.

Install

yarn add @sciopro/components or(npm run @sciopro/components) // 📦 components
yarn add @sciopro/hooks or(npm run @sciopro/hooks) // 🚀 hooks
yarn add @sciopro/utils or(npm run @sciopro/utils) // 🔧 utils

It is recommended to use pnpm to install

pnpm run @sciopro/components  // 📦 components
pnpm run @sciopro/hooks  // 🚀 hooks
pnpm run @sciopro/utils  // 🔧 utils

Component usage example

import React from 'react';
import { Button } from '@sciopro/components';

export default () => {
  return <Button>Button</Button>;
};

Hooks usage example

import React from 'react';
import { ViewportProvider, useViewport } from '@sciopro/hooks';
const MyComponent = () => {
  const { width, height } = useViewport();
  const breakpoint = 620;
  return width < breakpoint ? (
    <div>
      Hello, small screen, the current screen width and height is:width:{width},height:{height}
    </div>
  ) : (
    <div>
      Hello, big screen, the current screen width and height is:width:{width},height:{height}
    </div>
  );
};
export default () => {
  return (
    <ViewportProvider>
      <MyComponent />
    </ViewportProvider>
  );
};

Utils usage example

import React from 'react';
import { Add } from '@sciopro/utils';

export default () => {
  const [num, setNum] = React.useState(0);
  React.useEffect(() => {
    Add(num);
  }, [num]);
  return (
    <div>
      <button onClick={() => setNum(num + 1)}>x2</button>
      <h2>{num}</h2>
    </div>
  );
};

sciopro's People

Contributors

abinzhao avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.