react-chat-widget icon indicating copy to clipboard operation
react-chat-widget copied to clipboard

How to use setQuickButtons ?

Open WoodyFleurant opened this issue 5 years ago • 11 comments

Hi,

I am kind of new with reactJs and I can't succeed in using setQuickButtons. According to the documentation we should use an array of objects containing label and values.

I tried the following but it's not working

var buttons = { buttons: [ { label: 'My awesome link', value: 'https://github.com/Wolox/react-chat-widget', }] }

setQuickButtons(buttons);

Any help would be very appreciated

WoodyFleurant avatar Feb 08 '19 22:02 WoodyFleurant

Hi!

Yes, this method needs an array of objects with label and value properties set. The problem is that you're passing it an object instead of an array. Try this instead:

let buttons = [
  {
    label: 'My awesome link',
    value: 'https://github.com/Wolox/react-chat-widget',
  }
];

setQuickButtons(buttons);

Dorian30 avatar Feb 11 '19 19:02 Dorian30

It doesn't work.

TypeError: Object(...) is not a function
src/Chat.jsx:121
> 121 | 	setQuickButtons(buttons);

This is the version I use:

"react-chat-widget": "^2.1.4-1"

wiradikusuma avatar Feb 12 '19 11:02 wiradikusuma

Same error here, it does not work and i use the same exact version. Should we convert this issue into a bug ?

WoodyFleurant avatar Feb 15 '19 19:02 WoodyFleurant

Actually, i checked in node_modules, and the version retrieved does not include the latest change (and this latest change is bringing quickButtons)

WoodyFleurant avatar Feb 18 '19 20:02 WoodyFleurant

Seems like the readme.md does not reflect the latest released features

agonzalezmurua avatar Feb 25 '19 19:02 agonzalezmurua

Does anyone know when the version with quickButtons will be released?

TylerAngelier avatar Mar 14 '19 13:03 TylerAngelier

Is setQuickButtons still not accessible ?

mounabenayed avatar Apr 22 '19 09:04 mounabenayed

Is setQuickButtons still not accessible ?

Still not

ghost avatar May 08 '19 06:05 ghost

Any idea when the new release is going to be ?

mounabenayed avatar May 08 '19 10:05 mounabenayed

Still not released. Any updates? (^2.1.4-1)

thiagocavalcanti avatar Jul 01 '19 14:07 thiagocavalcanti

This can probably be closed since the functionality is there! @WoodyFleurant

luddilo avatar Aug 12 '20 14:08 luddilo