Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

messageBox props asking so many props #218

Open
praveengopu0105 opened this issue Feb 21, 2024 · 2 comments
Open

messageBox props asking so many props #218

praveengopu0105 opened this issue Feb 21, 2024 · 2 comments

Comments

@praveengopu0105
Copy link

i didnt know while working with typescript messageBox component asking so many required props but in documentation it having less props so when i just copy paste it is showing props are missing

@praveengopu0105 praveengopu0105 changed the title message props asking so many props messageBox props asking so many props Feb 21, 2024
@bhattiasad99
Copy link

Did you resolve this? Im facing the same issue

@Sorbuscorp
Copy link

Sorbuscorp commented Apr 22, 2024

I bypassed this problem with Partial type. In code it may looks like:

function message(id:string, text:string, position: string):Partial<MessageType>{
    return {
        position: position,
        type: 'text',
        text: text,
        // date: new Date(),
        title: position=="left" ? "AI" : "You" ,
        id: id,
        titleColor:"black",
        forwarded: false,
        focus: false,
        removeButton : false,
        replyButton : false,
        //status : "",
        notch : true,
        retracted : false,
    }
}

//example
let messages = [message("0", loremIpsum(), "right") ...];
<MessageList
                referance={messageListReferance}
                lockable={true}
                toBottomHeight={'50%'}
                dataSource={messages as MessageType[]}
            />

You can delete any fields in message function and it must be correct.

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