Skip to content

Commit

Permalink
✏️ Fix react README examples (baptisteArno#542)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
2 people authored and jmgoncalves97 committed Jan 17, 2025
1 parent b6bee8d commit c47a1c4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/embeds/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
```
Expand Down Expand Up @@ -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()
```
Expand All @@ -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()
```
Expand Down

0 comments on commit c47a1c4

Please sign in to comment.