【发布时间】:2021-04-14 04:36:05
【问题描述】:
我正在尝试在样式标签中编写两个表达式,但它一直给我以下错误The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.我该如何解决?
<table id='calendario'>
<tbody>
{linhas.map((linha) => (
<tr key={linha}>
{colunas.map((coluna , e , i) => (
<td
key={coluna} onLoad={() => {
if(e < index.length){e = e};
if(i >= proximo_mes.length){i = i};
}}
style={() => {if(linha == 0 && coluna == e){return {filter : 'brightness(0.6)'}};
if(linha == 4 && coluna == i){return{filter : 'brightness(0.6)'}}
else{return{filter : 'brightness(1)'}}}}
></td>
))}
</tr>
))}
</tbody>
</table>
【问题讨论】:
标签: javascript css reactjs frontend react-dom