What's the difference between react-redux @ connect () and connect () (App)?

@ connect in

react-redux, why can you get the properties in the object directly, while connect (mapStateToProps, mapDispatchToProps) (App) has to get the properties in the object manually? For example:

const initialState = {
    isAuth: false,
    username: "ok"
}

export function auth(state=initialState, action){
    ...
}

@connect(
    state => state.auth
)

class App extends Component{
    render(){
        return(
            {this.props.isAuth ? "<button></button>" : ""}
            ...
        )
    }
}

you can get isAuth directly by using the decorator here.

but change it to mapStateToProps to get isAuth , you have to write it this way:

const mapStateToProps = state => {
    return{
        isAuth: state.auth.isAuth
    }
}

isAuth,

const mapStateToProps = state => {
    return{
        auth: state.auth
    }
}
this.props.auth.isAuthisAuth

the question is what @ connect has done to the object auth so that we can get the isAuth? without writing isAuth: state.auth.isAuth .

Apr.07,2021

@connect(
    state => state.auth
)

@ connect accepts a function as an argument and unfolds the return value object of this function to the component, that is, props as the component

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b26d-2b5d3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b26d-2b5d3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?