Taro.Component Super expression must either be null or a function



  • I made a test with Taro.Component below:

    import React,{Component} from 'react'
    import Taro from '@tarojs/taro'
    import { View, Image } from '@tarojs/components'
    import { PromotionResponse, PromotionDto, TagDto, ChannelDto, ChannelType } from "../../../models/MeekouModel";
    import { MeekouApi } from '../../../utils/meekouApi';
    import { AtButton,AtIcon, AtToast, AtTag   } from 'taro-ui'
    import "../promotion.scss";
    
    export default class DetailPromotion extends Taro.Component {
        async componentDidShow () {
            console.log(this.$router.params);
        }
        render(){
            return (
                <View>
                    Test
                </View>
            );
        }
    }
    

    It will throw error "Super expression must either be null or a function"


登录后回复