“Zastosuj wiele obiektów stylowych w react JS” Kod odpowiedzi

Jak dodać atrybuty wielu stylów w elemencie React

style is just an Object, with css value turn to camelCase, so you could use any way to merge two object, and it should work.

ES6: style={Object.assign({}, style1, style2)}

ES7: style={{...style1, ...style2}}

lodash: style={_.merge({}, style1, style2)}
Kami

Zastosuj wiele obiektów stylowych w react JS

// REACT JS STYLING - Snippet 1

//--- Use belowe methods ---
ES6: style={Object.assign({}, style1, style2)}
ES7: style={{...style1, ...style2}}
Copy Paster

Odpowiedzi podobne do “Zastosuj wiele obiektów stylowych w react JS”

Pytania podobne do “Zastosuj wiele obiektów stylowych w react JS”

Więcej pokrewnych odpowiedzi na “Zastosuj wiele obiektów stylowych w react JS” w JavaScript

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu