Skip to content

_onImageChange Not Working/Being Recognised #45

Description

@razasekha

I am running React-Native 0.73 and am trying to use the image keyboard in my app. I have just been testing on Android for now.

Since installing the library and importing the react-native-image-keyboard, I can browse gifs and stickers, but when I click on one, nothing happens. I have added logs, none of which are being activated. I have tried an exact copy of the android example and that had the same issue.

index.js

import 'react-native-image-keyboard';
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import messaging from '@react-native-firebase/messaging';



// Register background handler
messaging().setBackgroundMessageHandler(async remoteMessage => {
    console.log('Message handled in the background!', remoteMessage);
  });

AppRegistry.registerComponent(appName, () => App);

And in My screen:

import {TextInput} from 'react-native';
  const [newMessage, setNewMessage] = useState(''); // Text for a new message

  const _onImageChange = event => {
    console.log('Test')
    const {uri, linkUri, mime, data} = event.nativeEvent;
    console.log('Yay, image received!', uri, linkUri, mime, data);

    // Do something with this data
  };

            <TextInput
              onImageChange={_onImageChange}
              style={styles.messageInput}
              value={newMessage}
              onChangeText={setNewMessage}
              placeholder="Type a message..."
              placeholderTextColor={'white'}
            />

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions