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

Not working if it is used multiple times #51

Closed
monicse09ku opened this issue Aug 7, 2020 · 2 comments
Closed

Not working if it is used multiple times #51

monicse09ku opened this issue Aug 7, 2020 · 2 comments

Comments

@monicse09ku
Copy link

I was having Invariant Violation issue on regular installation, thus I imported the script as a component and used it like the following

import ColorWheel from '../../components/ColorWheel';

<View style={{flexDirection:'row', justifyContent: 'center'}}>
    <View style={{width:'50%', paddingHorizontal: 5}}>
        <Label style={{fontSize: 14, fontWeight: 'bold', paddingVertical: 5, textAlign: 'center'}}>COLOR (IF Any)</Label>
            <ColorWheel
                initialColor="#ffffff"
                onColorChange={color => this.onColorChange(color)}
                thumbStyle={{ height: 30, width: 30, borderRadius: 30}}
                style={{ height: 180, width: 180, elevation: 100000}}
            />
         </View>
    </View>

 <View style={{flexDirection:'row', justifyContent: 'center'}}>
    <View style={{width:'50%', paddingHorizontal: 5}}>
        <Label style={{fontSize: 14, fontWeight: 'bold', paddingVertical: 5, textAlign: 'center'}}>COLOR (IF Any)</Label>
            <ColorWheel
                initialColor="#ffffff"
                onColorChange={color => this.onColorChange1(color)}
                thumbStyle={{ height: 30, width: 30, borderRadius: 30}}
                style={{ height: 180, width: 180, elevation: 100000}}
            />
         </View>
    </View>

It works fine if it is used single time, but I need to use it multiple time (5 times for 5 different colors). It stops working then, Nothing happens if the image is clicked or if the thumb is tried to drag.

Thanks in advance

@developernetset
Copy link

+1

@RickeyWard
Copy link
Collaborator

cleaning up old issues. Is this still an issue? or can we close it?

the invariant violation is due to updates in react not liking that there was no default value for radius, it has been addressed in master but not pushed to npm. There's no reason why it shouldn't work with multiple instances. What do you mean by nothing happens? no events fired?

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

3 participants