chatengine-io / react-chat-engine

React component for a cheap and easy chat API
140 stars 35 forks source link

some sort of type error #27

Closed Hussain-Shahid closed 3 years ago

Hussain-Shahid commented 3 years ago

import {ChatEngine} from 'react-chat-engine' import './App.css';

function App() { return ( <ChatEngine height="100vh" projectID="1a346ac3-aa55-4f49-aab1-2ccfe04b0598" userName="Hussainbutt" userSecret="1234"

/> ); }

export default App; image

alamorre commented 3 years ago

I'll take a look and publish a fix within 1-2 hours.

alamorre commented 3 years ago

Please let me know if the issue goes away in version 1.8.1 thanks a bunch! 😄

Hussain-Shahid commented 3 years ago

if you dont mind can you tell me why this issue occur i tried to resolve this by myself but failed .

On 31 Mar 2021 9:31 p.m., "Adam La Morre" @.***> wrote:

Please let me know if the issue goes away in version 1.8.1 thanks a bunch! 😄

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alamorre/react-chat-engine/issues/27#issuecomment-811215745, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALUWY52GIBHYYEBSNHFQAUDTGNE4JANCNFSM42E3J2VQ .

alamorre commented 3 years ago

Basically there was a race condition with loading the connection object, so in 1.8.1 it waits until the connection object has fully loaded. Again, please let me know if there are other issues - happy to fix them 👍👍

Hussain-Shahid commented 3 years ago

same issue

On 31 Mar 2021 9:58 p.m., "Adam La Morre" @.***> wrote:

Basically there was a race condition with loading the connection object, so in 1.8.1 it waits until the connection object has fully loaded. Again, please let me know if there are other issues - happy to fix them 👍👍

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alamorre/react-chat-engine/issues/27#issuecomment-811252283, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALUWY5ZFYFPRJFZZOXVTFY3TGNIELANCNFSM42E3J2VQ .

alamorre commented 3 years ago
Screen Shot 2021-03-31 at 10 35 52 AM
import React, { Component } from 'react';
import {ChatEngine} from 'react-chat-engine'

export default class DirectChatsPage extends Component {
    render() {
        return (
            <ChatEngine
                height="100vh"
                projectID="1a346ac3-aa55-4f49-aab1-2ccfe04b0598"
                userName="Hussainbutt"
                userSecret="1234"
            />
        );
    }

}

This looks fine to me

Hussain-Shahid commented 3 years ago

use props username and enter the correct username then you will get the error

On 31 Mar 2021 10:36 p.m., "Adam La Morre" @.***> wrote:

[image: Screen Shot 2021-03-31 at 10 35 52 AM] https://user-images.githubusercontent.com/15023107/113186738-07ab2000-9226-11eb-918a-d3497c9e2813.png `import React, { Component } from 'react'; import {ChatEngine} from 'react-chat-engine'

export default class DirectChatsPage extends Component { render() { return (

); }

}`

This looks fine to me

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alamorre/react-chat-engine/issues/27#issuecomment-811278430, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALUWY52CLFARRGVQLJAQOS3TGNMSJANCNFSM42E3J2VQ .

alamorre commented 3 years ago

Lol I'm pushing out 1.8.2 which will handle Null and Undefined. Let me know if 1.8.2 works

1.8.X has a lot of powerful updates which will allow TONS of customizations. Please bare with me this will be worth it! 😁

BinarySenseiii commented 3 years ago

still not fixed i update t0 1.8.2 Screenshot (32) Screenshot (33)

Screenshot (34)

IZACK96 commented 3 years ago

I have tried version 1.8.2 and the userName error is gone, but now as i try to customize the chat feed with "renderChatFeed", i get this error Capture1

alamorre commented 3 years ago

@ anybody who wants to try 1.8.3 please let me know if the issues are going away. I ran into some on my own and I think i got it...

yarn add react-chat-engine@1.8.3

basileLeroy commented 3 years ago

image

It seems that this error message shown above only happens every once in a while for me.

EDIT: The above issue seems to have been fixed with the 1.8.3 version


image

On the other hand, I seem to have problems when entering new messages. on enter/submit (same handler), I get the TypeError above.

image My console log seems to be showing it fine though..


My engine:

<ChatEngine
        height="100vh"
        userName="Tetris"
        userSecret="XXXXXX"
        projectID="3f78a1ff-b807-4a82-b8e1-aeab29b74a34"
        renderChatFeed={(chatroomProps) => <ChatFeed {... chatroomProps} /> }                   
/>

My send message handler inside component (MessageForm):

const [value, setValue] = useState('');
const { creds, chatID } = props;

const handleSubmit = (event) => {
        event.preventDefault();
        const text = value.trim();

        if (text.length > 0) {
            sendMessage(creds, chatID, { text });
       }
       setValue('');
};

and my component:

<MessageForm {...props} chatID={activeChat} />

I hope this was enough info to find an answer! :) If not let me know, i am just a rookie!

BinarySenseiii commented 3 years ago

image

It seems that this error message shown above only happens every once in a while for me.

EDIT: The above issue seems to have been fixed with the 1.8.3 version

image

On the other hand, I seem to have problems when entering new messages. on enter/submit (same handler), I get the TypeError above.

image My console log seems to be showing it fine though..

My engine:

<ChatEngine
        height="100vh"
        userName="Tetris"
        userSecret="XXXXXX"
        projectID="3f78a1ff-b807-4a82-b8e1-aeab29b74a34"
        renderChatFeed={(chatroomProps) => <ChatFeed {... chatroomProps} /> }                 
/>

My send message handler inside component (MessageForm):

const [value, setValue] = useState('');
const { creds, chatID } = props;

const handleSubmit = (event) => {
        event.preventDefault();
        const text = value.trim();

        if (text.length > 0) {
            sendMessage(creds, chatID, { text });
       }
       setValue('');
};

and my component:

<MessageForm {...props} chatID={activeChat} />

I hope this was enough info to find an answer! :) If not let me know, i am just a rookie!

m facing the same issue

alamorre commented 3 years ago

Closed due to inactivity