byjus-searchbar-widget

1.0.17-alpha.12 • Public • Published

byjus-searchbar-widget

widget for byjus qna searchbar

NPM JavaScript Style Guide

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

/byjus-searchbar-widget/

    Package Sidebar

    Install

    npm i byjus-searchbar-widget

    Weekly Downloads

    1

    Version

    1.0.17-alpha.12

    License

    MIT

    Unpacked Size

    640 kB

    Total Files

    8

    Last publish

    Collaborators

    • byjusplo