Skip to main content


Module Overview

While optional, Keywork uses React as its primary HTML templating engine.

Peer Dependencies

If you haven't already, make sure to add the React peer dependencies:

Run in the root of your project.
$ yarn add react react-dom


Route handlers defined on an instance of RequestRouter can return a React component, Keywork automatically converts the content into a streamed response.

import { RequestRouter } from 'keywork/router'

const app = new RequestRouter()

app.get('/', () => <h1>Hello from Keywork! 👋</h1>)

interface GreetParams {
firstName: string

app.get('/greet/:firstName', ({ params }) => {
return (
<h1>Hello there! {params.firstName}</h1>

export default app


import * as ReactUtils from 'keywork/react'