From ac9ff4467883e29a18b68e2827f4923e1e3b54a5 Mon Sep 17 00:00:00 2001 From: pixelnode Date: Wed, 14 Aug 2024 10:37:41 +0400 Subject: [PATCH] Fix another Typo in README [How to Use.md] --- docs/how-to-use.md | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/docs/how-to-use.md b/docs/how-to-use.md index 2ed4ead..777042b 100644 --- a/docs/how-to-use.md +++ b/docs/how-to-use.md @@ -1,8 +1,10 @@ # How to Use + Here are the basic of how to use callbacks and expose functions from the plugin. You can see the list of APIs in this [API reference](api-reference.md). ## Expose functions + To access the expose functions, you will need to use **useRef** from react. Create a constant variable that will hold the **useRef()** and pass it in **TawkMessengerReact** component as a prop. @@ -24,29 +26,30 @@ function App() { + ref={tawkMessengerRef}/> ); } ``` ## Using Callbacks + Using the API callbacks, pass a function as props on the callback you will used. ```js function App() { - const onLoad = () => { - console.log('onLoad works!'); - }; - - return ( -
- -
- ); + const onLoad = () => { + console.log('onLoad works!'); + }; + + return ( +
+ +
+ ); } ``` -