Just learn how to optimize this code by react,. Can you help me to change it?

componentWillReceiveProps =(newProps)=> {

        const _self = this;
        //console.log("");
        //console.log("newProps = ", newProps["basicInformationData"]);
        let videoLength = 0;
        let videoSize = 0;
        let distanceCreationTime = 0;

        let tags = []

        if( newProps["basicInformationData"] !== undefined) {
            if ( newProps["basicInformationData"]["distance_time"] !== undefined ) {
                distanceCreationTime = newProps["basicInformationData"]["distance_time"]
            }

            if ( newProps["basicInformationData"]["duration"] !== undefined ) {
                videoLength = newProps["basicInformationData"]["duration"]
            }

            if ( newProps["basicInformationData"]["size"] !== undefined ) {
                videoSize = newProps["basicInformationData"]["size"]
            }

            if ( newProps["basicInformationData"]["tags"] !== undefined ) {
                tags = newProps["basicInformationData"]["tags"]
            }
        }

        _self.setState({
            tags: tags, // 
            videoLength: videoLength,
            videoSize: videoSize,
            distanceCreationTime: distanceCreationTime
        })


    }

how to optimize the following paragraph?

_self.setState({
            tags: tags, // 
            videoLength: videoLength,
            videoSize: videoSize,
            distanceCreationTime: distanceCreationTime
        })

how to optimize this if

if( newProps["basicInformationData"] !== undefined) {
            if ( newProps["basicInformationData"]["distance_time"] !== undefined ) {
                distanceCreationTime = newProps["basicInformationData"]["distance_time"]
            }

            if ( newProps["basicInformationData"]["duration"] !== undefined ) {
                videoLength = newProps["basicInformationData"]["duration"]
            }

            if ( newProps["basicInformationData"]["size"] !== undefined ) {
                videoSize = newProps["basicInformationData"]["size"]
            }

            if ( newProps["basicInformationData"]["tags"] !== undefined ) {
                tags = newProps["basicInformationData"]["tags"]
            }
        }
Apr.19,2021

const obj = newProps['basicInformationData'] || {}
let distanceCreationTime = obj['distance_time'] || 0;
let videoSize = obj['size'] || 0;
let videoLength =  obj['duration'] || 0;
let tags = obj['tags'] || []
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-1e88ee6-f16.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-1e88ee6-f16.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?