It has been nearly a month since taro-HookSv1.0.0 was released. Tarol-hooks have released six more releases (three fixes and three minor releases). Tarol-hooks continue to maintain updates roughly one release per week. Taro-hooks currently have 37+hooks available. Nearly 60% of the official apis are covered.

Taro-hooks are currently available in the latest version v1.3.0.

The profile

This update mainly focuses on the exclusive hooks of small programs, adding common hooks such as:

  • useScanCode: Scan code correlation
  • useAuthorize: authorization, setting authorization related
  • useLogin: Login related
  • useUserInfo: Obtain and display user information

other

  • Added scaffolding templates added taro Init initialization to create templates. The specific usage is as follows:

    // Make sure the node version is in 12+ $node -v $v12.22.1 $NPX @tarojs/cli init taro-hooks-demo // framework select React $? Please select framework React // template source select: github (make sure to pull to taro-hooks template) $? Please select the template source $Gitee (fastest) $❯ Github (latest) // When prompted to select a template: Select the taro-hooks template $? $mobx $react-native $redux $❯ tarry-hooks $tarry-ui $tarry-hooks To view a template example, run $CD tarry-links-demo $YARN dev: retry p $YARN dev:h5Copy the code
  • Taro-hooks support tree shaking based on ES Modules by default. However, you can explicitly use babel-plugin-import to set on-demand loading as follows:

    // babel.config.js
    module.exports = {
      plugins: [
        [
          'import',
          {
            libraryName: 'taro-hooks',
            camel2DashComponentName: false,
          },
          'taro-hooks',
        ],
      ],
    };
    Copy the code

Update log

Bugfix & Improvment

  • update useSystemInfo and useLaunchOptions (6c08d96)
  • update useStorage to sync (18f96f4)
  • fix useBattery ios level async problem (5c3d937)
  • fix useVibrate interval to auto close (8e4808e)
  • improve useUpdateManager behavior and app index check update (411684c)

Feature

  • Update taro Version to 3.3.6(latest) (547080a)
  • add useAccountInfo hook (cd8aa61)
  • add useAuthorize hook (c0ec57c)
  • add useLogin, useUserInfo hooks (fa74d86)
  • add useScanCode hook (1a55a65)

Check out more update logs

recommended

There is an idea, also began to develop, write a front-end tools small website. At present, the commonly used picture compression is realized. More commonly used tools will be enriched later. I hope you can mention more issues and PR together!

  • Web site address
  • GITHUB-general-tools