npm install renku- signal-polyfill for reactivity
- capnweb for RPC
- @sqlite.org/sqlite-wasm for client data storage
``sh`
bun create github.com/renkudev/template-bun
`sh`
bun create github.com/renkudev/template-vite
Renku uses the class prop to apply CSS classes to its components (as opposed to className in React). Using className will still work though. The prop accespts either a string or an array of strings.
`ts`
`ts
import { createSignal, createComputed, type FunctionComponent } from "renku";
export const Counter: FunctionComponent<{ start: number }> = ({ start }) => {
const counter = createSignal(start);
const isEven = createComputed(() => counter.get() % 2 === 0);
return (
Context
`ts
import { createContext } from "renku";export const context: Context<{
counter: Signal.State;
}> = createContext();
export const Parent: FunctionComponent = ({
children,
}) => {
const counter = createSignal(0);
context.set({ counter });
return
{children};
};export const Child: FunctionComponent = ({
children,
}) => {
const counter = createSignal(0);
context.get({ counter });
return (
);
};export const App: FunctionComponent = () => {
return (
);
};
``