import React, { useEffect, useState } from 'react'; import TagCom from './IOTWeather'; const Build: React.FC = (props: any) => { const { attrData, uiStreams, weatherInfo } = props; const [attr, setAttr] = useState({}); useEffect(() => { const weather: any = {} Object.keys(attrData['weather']).forEach((key: any) => { const flag = attrData['weather'][key]; weather[key] = { ...weatherInfo[key], flag } }) const attr = { weather } // attr['originType'] && delete attr.originType; setAttr({ ...attr }); }, [uiStreams,weatherInfo]); return (<> { JSON.stringify(attr) === "{}" ? (
) : () } ) } export default Build;