I have tried using the module while using react-native-cli. After some time I managed to get it to work. I have however now tried to use it using Expo, and I keep getting the same error:
I have the following code:
import React, {useEffect, useState} from 'react'
import { View, Button, Text} from 'react-native';
import * as Mqtt from 'react-native-native-mqtt';
import buffer from 'buffer'
global.Buffer = buffer.Buffer;
Hello!
I have tried using the module while using react-native-cli. After some time I managed to get it to work. I have however now tried to use it using Expo, and I keep getting the same error:
I have the following code: import React, {useEffect, useState} from 'react' import { View, Button, Text} from 'react-native'; import * as Mqtt from 'react-native-native-mqtt'; import buffer from 'buffer' global.Buffer = buffer.Buffer;
const Mqtt = ({client}) => { const [error, setError] = useState(''); const [payload, setPayload] = useState(''); const [connectStatus, setConnectStatus] = useState('Disconnected');
} export default Mqtt;
Does anyone have a tip, or experienced similar things?