修饰器注入

2019-11-11  本文已影响0人  立陶宛_d5a9

import React, { Component } from "react";
import { View, Text } from "react-native";
//@ts-ignore
function test(Tag){
//@ts-ignore
var Tag = ()=><Tag></Tag> //@ts-ignore class App2 extends Component{ componentWillMount() { alert('注入周期') } render() { //@ts-ignore returnTag()
}
}
return ()=><App2/>
}
//@ts-ignore
@test
class App extends Component {
componentWillMount() {
alert('原生周期')
}
scrollView: any;
currIndex: number;
timer: any;
state = {
hide: true
};
render() {
return (
<View>
<Text>原始页面</Text>
</View>
);
}
}
export default App;

上一篇 下一篇

猜你喜欢

热点阅读