From 61fd44f768d80f7298db689e4dde4c94327fdf6f Mon Sep 17 00:00:00 2001 From: Denis Ciccale <539546+dciccale@users.noreply.github.com> Date: Mon, 5 Jun 2023 08:50:34 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20react=20README=20exa?= =?UTF-8?q?mples=20(#542)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit open, close and toggle are apparently exported from @typebot.io/js package or at least that's what worked for me, I was getting unknown function error when trying to import them from @typebot/react aslo in order for Typebot.showPreviewMessage() and Typebot.hidePreviewMessage() to work, I need to import all exports as Typebot, otherwise it didn't seem to have the named exports "showPreviewMessage" nor "hidePreviewMessage", since I was also getting an error when trying to import them. this is my first PR here, I apologise for mistakes upfront. It's ok if it is not meged, I just wanted to catch your attention on this potential update required in the documentation of react embed --------- Co-authored-by: Baptiste Arnaud --- packages/embeds/react/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/embeds/react/README.md b/packages/embeds/react/README.md index 61091eab2..785a6d0e1 100644 --- a/packages/embeds/react/README.md +++ b/packages/embeds/react/README.md @@ -38,19 +38,19 @@ This code will automatically trigger the popup window after 3 seconds. You can use these commands: ```js -import { open } from '@typebot.io/react' +import { open } from '@typebot.io/js' open() ``` ```js -import { close } from '@typebot.io/react' +import { close } from '@typebot.io/js' close() ``` ```js -import { toggle } from '@typebot.io/react' +import { toggle } from '@typebot.io/js' toggle() ``` @@ -85,13 +85,13 @@ This code will show the bubble and let a preview message appear after 5 seconds. You can use these commands: ```js -import { showPreviewMessage } from '@typebot.io/react' +import { showPreviewMessage } from '@typebot.io/js' Typebot.showPreviewMessage() ``` ```js -import { hidePreviewMessage } from '@typebot.io/react' +import { hidePreviewMessage } from '@typebot.io/js' Typebot.hidePreviewMessage() ``` @@ -101,19 +101,19 @@ Typebot.hidePreviewMessage() You can use these commands: ```js -import { open } from '@typebot.io/react' +import { open } from '@typebot.io/js' open() ``` ```js -import { close } from '@typebot.io/react' +import { close } from '@typebot.io/js' close() ``` ```js -import { toggle } from '@typebot.io/react' +import { toggle } from '@typebot.io/js' toggle() ```