taro hooks

taro 使用react hooks

import Taro, { useState } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import './index.less'

const Child = (props)=>{
    return <Text>Child Name: {props.userName}</Text>
}

export default function App() {
  const [info,] = useState('island')
  const [userName,] = useState('child island')
  
  return (
    <View className='index'>
      <Text userName={userName}>{info}</Text>
    </View>
  )
}
posted @ 2022-03-07 20:28  IslandZzzz  阅读(130)  评论(0编辑  收藏  举报