美文网首页
修饰器注入

修饰器注入

作者: 立陶宛_d5a9 | 来源:发表于2019-11-11 20:56 被阅读0次

    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;

    相关文章

      网友评论

          本文标题:修饰器注入

          本文链接:https://www.haomeiwen.com/subject/ffjxictx.html