0.1.11 • Published 1 year ago
type-ahead-using-css-bootstrap v0.1.11
In the main file where the component is to be used you gotta copy the code below.
import { useState } from 'react';
import SearchBox from 'type-ahead-using-css-bootstrap';
function App() {
const searchLink, setSearchLink=useState('{searchLinkApi}'); const recentLink, setRecentLink=useState('{recentLinkApi}');
const searchBoxPropsGet=({...otherProps})=>{ const searchBoxProps={ searchLink: searchLink, recentLink: recentLink, ...otherProps };
return (
<div className="">
<SearchBox {...searchBoxPropsGet({props:'yes'})}/>
</div>
); }
Props
Both the apis are to be sent in an object via a function called 'searchBoxPropsGet' along with spread operator. Configure the api(s) as you wish for different data.