Problems with the addition of style styles in react lines

question: why doesn"t the style work when an object is put into style= {} in
react?

Code:

loadCssFunc = ()=>{
    return {
        color:"red",
        fontSize:12
    }
}

//render()

<div style={this.loadCssFunc}></div>

can"t be written in this way

Mar.03,2021

add: you can use it, but you don't usually use it that way.
unless you need to add a dynamic value to the style after executing a method. For example, when you finish executing this method, change the fontSize:

const loadCssFunc = {
        color:'red',
        fontSize:12
    }

//render()

<div style={loadCssFunc}></div>
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-1e53503-45222.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-1e53503-45222.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?