I'm currently one small project based on preactJS with algolia? I found that there is algolia component for reactjs but unfortunately, no algolia component for preactjs. That's why my problem is how can I include algolia javascript file into preactjs?
<script src="https://cdn.jsdelivr.net/instantsearch.js/1/instantsearch.min.js"></script>
Preact has component Head. To install it run
yarn add preact-head
Then it will be possible to specify standard head element such as script, meta, etc.. E.x. app.js
import Head from "preact-head";
export default class App extends Component {
render() {
return (
<div id="app">
<Head>
<meta name="Whatever" />
<script src="https://cdn.jsdelivr.net/instantsearch.js/1/instantsearch.min.js"></script>
</Head>
</div>
);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With