From 002b8ce0edb5956a2b81232f8d0d392e45e0f1fa Mon Sep 17 00:00:00 2001 From: Dion-Ahmetaj Date: Sun, 2 Nov 2025 15:10:23 +0200 Subject: [PATCH] docs: added a React example usage --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index d4a5f743..79ed4442 100644 --- a/README.md +++ b/README.md @@ -979,6 +979,30 @@ HelloJS relies on these fantastic services for it's development and deployment, - [BrowserStack](https://www.browserstack.com/) for providing a means to test across multiple devices. +### Example usage with React + +If you want to use **hello.js** in a React project: + +```jsx +import hello from 'hellojs'; + +hello.init({ + google: 'YOUR_GOOGLE_CLIENT_ID', +}); + +function LoginButton() { + const handleLogin = () => { + hello('google') + .login() + .then(() => alert('Logged in!')); + }; + + return ; +} + +export default LoginButton; + + ## Can I contribute?