Writing a Plugin
Grid.js Plugins are Preact Functional Components. Simply create a new functional component to render a plugin:
import { h } from "gridjs";
function MyPlugin () {
return h('h1', {}, 'Hello World!');
}
tip
You don't have to use the h
function to render elements if your bundler is set up to understand Preact JSX renderer:
function MyPlugin () {
return <h1>Hello World!</h1>;
}
See this guide for more details https://preactjs.com/guide/v10/getting-started#setting-up-jsx
Live Editor
Result
Loading...