mastermoo / react-native-action-button

customizable multi-action-button component for react-native
MIT License
2.52k stars 570 forks source link

active props is not working #319

Open ansarikhurshid786 opened 5 years ago

ansarikhurshid786 commented 5 years ago

I want to close/deactivate others all floating button when user click not active floating button.

I tried something like this:

state = {
   manyChildFabs: false
}
commonFabToggle = ()=>{
         this.setState({manyChildFabs: false });
}

View :

<ActionButton activate={this.state.manyChildFabs}> 
<ActionButton.Item>
<Text> Test </Text> 
</ActionButton.Item>
</ActionButton> 
EduVencovsky commented 5 years ago

You have a typo, it's active not activate.

ansarikhurshid786 commented 5 years ago

@EduVencovsky Thanks, Yes I tried with active but not working

waltershub commented 5 years ago

@ansarikhurshid786 it seems this prop on works in the initial mount, I got it working (in a wacky way) by conditionally mounting the component until after my fetch

       {showActionButtons ? (
          <ActionButtonGroup
            activeInit={SOMEBOOLEAN}
          />
        ) : null}

I don't think this is a bug, because if if it worked like you would want it to then it the main button click would be over ridden by state

is343 commented 4 years ago

This is an old issue, but you have to use resetToken.