byjus-searchbar-widget
v1.0.17-alpha.12
Published
Searchbar widget for Byjus Web QnA platform
Downloads
7
Readme
byjus-searchbar-widget
widget for byjus qna searchbar
Install
npm install --save byjus-searchbar-widget --legacy-peer-deps
Usage
import React, { Component } from 'react'
import { useEffect, useState } from 'react';
import { SearchbarComponent } from 'byjus-searchbar-widget'
import 'byjus-searchbar-widget/dist/index.css'
import 'byjus-searchbar-widget/dist/cropper.css'
class Example extends Component {
render() {
var [routeUrl, setRouteUrl] = useState(null);
useEffect(()=>{
if(routeUrl){
console.log(routeUrl)
}
}, [routeUrl])
return <SearchbarComponent
apiEndpoint = 'API_ENDPOINT' //String
userToken = 'USER TOKEN' //String
origin = 'ORIGIN' //String
authKey = 'AUTH KEY' //String
setRouteUrl = {el => setRouteUrl(el)} //Output url for redirection
/>
}
}
License
MIT © arjunramesan01