json
react-router

json

json<Data>(data, init): Response

This is a shortcut for creating application/json responses. Converts data to JSON and sets the Content-Type header.

Parameters

  • data: Data
  • init: number | ResponseInit
Docs and examples CC 4.0