Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onActiavte and onDeactivate need to be independent of onChangeState and active #26

Open
manjeets12 opened this issue Jun 14, 2017 · 0 comments

Comments

@manjeets12
Copy link

          <Switch
            active ={this.state.active}
            style={{borderWidth:1.3, borderColor:'#cfcfcf', padding:0, margin:0}}
            switchWidth ={48}
            switchHeight={20}
            buttonRadius={14}
            inactiveButtonColor={"#cfcfcf"}
            activeButtonColor={"#fc973d"}
            activeButtonPressedColor={"#fc973d"}
            inactiveButtonPressedColor={'#cfcfcf'}
            inactiveBackgroundColor={"#FFFFFF"}
            activeBackgroundColor={"#ffe0b2"}
            inactiveBackgroundColor={"#e0e0e0"}
            onChangeState={(state)=>{this.setState({active:state})}}
             onActivate={() => {console.log("onActive"}}
             onDeactivate={() => {console.log("onDeactive"}/>

I conclude that onChangeState must depends on onActivate and onDeactivate, but not viceversa. I mean it is totally strange that onActivate or deactivate is called upon changing state from somewhere else too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant