Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0.7 ReactNative useRouter为undefined #8353

Open
lifudea opened this issue Dec 23, 2020 · 1 comment
Open

2.0.7 ReactNative useRouter为undefined #8353

lifudea opened this issue Dec 23, 2020 · 1 comment
Labels
F-react Framework - React T-rn Target - 编译到 React Native V-2 Version - 2.x

Comments

@lifudea
Copy link

lifudea commented Dec 23, 2020

相关平台

React Native

使用框架: React

复现步骤

import Taro, { Component, useState, useEffect, useRouter } from '@tarojs/taro'

const router = useRouter();

期望结果

获取到路由对象

实际结果

获取路由对象失败

环境信息

👽 Taro v2.0.7

error: unknown option `-v'
hello@hellodeAir taro-native-shell % taor info
zsh: command not found: taor
hello@hellodeAir taro-native-shell % taro info
👽 Taro v2.0.7


  Taro CLI 2.0.7 environment info:
    System:
      OS: macOS 10.15.3
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 10.16.0 - /usr/local/bin/node
      Yarn: 1.22.4 - /usr/local/bin/yarn
      npm: 6.9.0 - /usr/local/bin/npm
    npmPackages:
      react: 16.8.0 => 16.8.0 
      react-native: 0.59.9 => 0.59.9 
@taro-bot2 taro-bot2 bot added F-react Framework - React T-rn Target - 编译到 React Native V-2 Version - 2.x labels Dec 23, 2020
@shinken008
Copy link
Collaborator

看了下代码,貌似不支持 useRouter。

const Taro = {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-rn Target - 编译到 React Native V-2 Version - 2.x
Projects
None yet
Development

No branches or pull requests

2 participants