我们知道ts是要被转换成js进行页面跳转的,但ts毕竟不同于js,需要加一些东西
其他的就不说了,能看懂的自然看懂
import
*
as
React
from
'react'
;
import
{
View
,
Text
,
Button
,
}
from
'react-native'
;
import
Videoscreen
from
'../video/video'
interface
Props
{
navigation
:
any
}
interface
State
{
}
import
{
StackNavigator
}
from
'react-navigation'
;
class
HomeScreen
extends
React
.
Component
<
Props
,
State
> {
static
navigationOptions
=
{
title:
'Main'
,
}
render
(){
return
<
View
>
<
Text
>
hello react-native00
</
Text
>
<
Button
onPress
=
{
()
=>
this
.
props
.
navigation
.
navigate
(
'profile'
, {
name:
'Lucy'
})
}
title
=
"Go to Lucy's profile"
/>
</
View
>
}
其他的就不说了,能看懂的自然看懂