How do you merge multiple inline style objects? in REACT

Practice



  1. You can use the spread operator in ordinary React:

     <button style={{...styles.panel.button, ...styles.panel.submitButton}}>{'Submit'}</button>
     
    If you are using React Native, you can use the array notation:
    1. <button style={[styles.panel.button, styles.panel.submitButton]}>{'Submit'}</button>
    2.  
     

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Scripting client side JavaScript, jqvery, BackBone"

Terms: Scripting client side JavaScript, jqvery, BackBone