JSPM

@wretched-tui/react

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q63048F
  • License MIT

React Reconciler and renderer for Wretched

Package Exports

  • @wretched-tui/react
  • @wretched-tui/react/.dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@wretched-tui/react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Wretched + React

See Wretched for more info about Wretched itself. This library adds a React renderer/reconciler.

import React, {useReducer} from 'react'
import {interceptConsoleLog} from '@wretched-tui/wretched'
import {
  Box,
  Button,
  Stack,
  run,
} from '@wretched-tui/react'

// Recommended:
interceptConsoleLog()

function App() {
  const [bang, goto10] = useReducer((state) => state + '!', '')

  return <Box border="single">
    <Stack.down>
      First there was Ncurses{bang}
      <Button onClick={goto10}>Tell me more!</Button>
    </Stack.down>
  </Box>
}

run()