How to combine multiple inline style objects?

后端 未结 17 1565
难免孤独
难免孤独 2020-11-28 18:54

In React you can clearly create an object and assign it as an inline style. i.e.. mentioned below.

var divStyle = {
          


        
17条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 19:49

    So basically I'm looking at this in the wrong way. From what I see, this is not a React specific question, more of a JavaScript question in how do I combine two JavaScript objects together (without clobbering similarly named properties).

    In this StackOverflow answer it explains it. How can I merge properties of two JavaScript objects dynamically?

    In jQuery I can use the extend method.

提交回复
热议问题