terrylinla / react-native-sketch-canvas

A React Native component for drawing by touching on both iOS and Android.
MIT License
696 stars 453 forks source link

Error on touch (iOS, RN 0.58.6) #111

Closed Beeltec closed 5 years ago

Beeltec commented 5 years ago

Hi,

I started to implement the component, trying out the basic example:

import { SketchCanvas } from '@terrylinla/react-native-sketch-canvas';
...
render() { 
    return( 
        <View> 
            <SketchCanvas 
                localSourceImage={ 
                    { 
                        directory: 'MAIN_BUNDLE',
                        filename: 'test.png',  
                        mode: 'AspectFill' 
                    } 
                } 
                strokeColor={'black'} 
                strokeWidth={7} 
                style={{width: 300, height: 200, backgroundColor: 'red'}} 
            /> 
        </View> 
    ); 
}

Unfortunately it doesn't work, yet. Everytime I touch on the canvas, I get the following error: "Argument 1 (NSInteger) of UIManager.dispatchViewManagerCommand must not be null".

The localSourceImage doesn't work either, but that's a bridge I'll plan to cross another time.

Beeltec commented 5 years ago

Okay, I found my mistake. I installed react-native-sketch-canvas before switching to @terrylinla/react-native-sketch-canvas and the old library was still linked.