0.1.3 • Published 3 years ago

@a2670392079/react-toolkit v0.1.3

Weekly downloads
-
License
BSD
Repository
github
Last release
3 years ago

React常用的一些hooks和component

hooks例如useAdditionState:

import React, {useMemo} from "react";
import useAdditionState from "react-utils";
// import Map from 'lib';
// ...



const components: React.FC = () => {

    // 其他库中的对象;
    const obj = useMemo(() => {
        return Map({
            container: 'test',
            url: 'mapurl'
        })
    }, [])
    const mapState = useAdditionState(obj);
    return
    <>
        <div id="test"/>
        {
            // mapState行为与普通state一致
            // <childComponent mapState={mapState} />
        }
    </>
}
0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago