Fetch the repository succeeded.
Hooks Library for Taro
# npm
$ npm i taro-hooks
# yarn
$ yarn add taro-hooks
# pnpm
$ pnpm add taro-hooks
We use plugins for extending different frameworks. So you need to install the corresponding plugins according to the framework you are currently using
# npm
$ npm i @taro-hooks/plugin-react
# yarn
$ yarn add @taro-hooks/plugin-react
# pnpm
$ pnpm add @taro-hooks/plugin-react
// config/index.js
module.exports = {
// ...
plugins: ['@taro-hooks/plugin-react'],
// ...
};
# npm
$ npm i @taro-hooks/plugin-vue
# yarn
$ yarn add @taro-hooks/plugin-vue
# pnpm
$ pnpm add @taro-hooks/plugin-vue
// config/index.js
module.exports = {
// ...
plugins: ['@taro-hooks/plugin-vue'],
// ...
};
import { useEnv } from 'taro-hooks';
function Index() {
const env = useEnv();
return <View>current env: {env}</View>;
}
<template>
<view>current env: {{env}}</view>
</template>
<script setup lang="ts">
import { useEnv } from 'taro-hooks';
const env = useEnv();
</script>
packages | downloads | version | license |
---|---|---|---|
|
|
|
See Contributing Guide.
innocces 💬 📖 👀 📢 🤔 ⚠️ 📦 📋 🎨 |
ryan 📖 📢 🤔 💻 |
MIT.
|
![]() |
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
Activity
Community
Health
Trend
Influence
:Code submit frequency
:React/respond to issue & PR etc.
:Well-balanced team members and collaboration
:Recent popularity of project
:Star counts, download counts etc.