Skip to content
effective-rsc
DocumentationIndex

An Effectful Server Component

Component runs its render Effect in the current ERSC render scope.

10_component.tsx
import { Effect } from 'effect';
import { Application } from 'effective-rsc';

const ERSC = Application.ersc();

export const ExchangeRate = ERSC.Component.make({
  render: ({ euros }: { readonly euros: number }) =>
    Effect.succeed(
      <p>
{euros} is approximately ${(euros * 1.17).toFixed(2)}
      </p>,
    ),
});