Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

246
Views
React Native Button taking CSS of Previous Button

I am setting Buttons stack on the basis of a variable whether channel is joined or not. One button is "Join Channel" which a plain text button Second button is "End Call" button which is a Circular button with an icon. Both have different CSS. When I click on "Join Channel", channel is joined and my stack is changed. Then I click on "End call" button, but CSS of this button does not remove and applied to "Join Channel" Button. Background color is not removed.

Rendering Code:

{this.state.isJoined ? this._callButtonsView() : this._joinButtonView()}
_joinButtonView = () => {
    return (
      <View style={styles.buttonsContainer}>
        <Button
          title="Join Channel"
          buttonStyle={styles.joinButton}
          titleStyle={{color: 'green', fontSize: 20}}
          onPress={() => this._joinChannel()}
        />
      </View>
    );
  };

  _callButtonsView = () => {
    return (
      <View style={styles.buttonsContainer}>
        <Button
          icon={{
            name: 'call-end',
            color: '#ff0000',
            size: 25,
          }}
          buttonStyle={styles.actionButton}
          onPress={() => this._leaveChannel()}
        />
      </View>
    );
  };

CSS:

actionButton: {
    backgroundColor: 'blue',
    padding: 0,
    height: 50,
    width: 50,
    marginRight: 25,
    marginTop: 5,
    marginBottom: 5,
    borderRadius: 25,
  },
  joinButton: {
    backgroundColor: 'clear',
  },

Video:

enter image description here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!