[PR #763] [MERGED] fix(react/examples): import createRoot from package #1546

Closed
opened 2026-03-14 09:42:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/763
Author: @nicolasff
Created: 3/1/2026
Status: Merged
Merged: 3/6/2026
Merged by: @kommander

Base: mainHead: text-example-import


📝 Commits (1)

  • 6143b9c fix(react/examples): import createRoot from package

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 packages/react/examples/text.tsx (+1 -1)

📄 Description

The text.tsx example for React imported createRoot from "../src" instead of referencing the "@opentui/react" package like in other examples.


Other imports in the same directory

All other .tsx files under packages/react/examples import createRoot using the @opentui/react package name, instead of a relative path (GitHub search).

Reusing this example/demo script

This relative import worked if the example was used from within this repo, but it prevented this demo file from being used separately:

curl -s https://raw.githubusercontent.com/anomalyco/opentui/main/packages/react/examples/text.tsx > text.tsx
bun install @opentui/react @opentui/core react
bun run ./text.tsx

This fails with:

error: Cannot find module '../src' from '/private/tmp/import-repro/text.tsx'

Bun v1.3.10 (macOS arm64)

After this fix

curl -s https://raw.githubusercontent.com/nicolasff/opentui/text-example-import/packages/react/examples/text.tsx > text.tsx
bun install @opentui/react @opentui/core react
bun run ./text.tsx

(works as expected)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/763 **Author:** [@nicolasff](https://github.com/nicolasff) **Created:** 3/1/2026 **Status:** ✅ Merged **Merged:** 3/6/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `text-example-import` --- ### 📝 Commits (1) - [`6143b9c`](https://github.com/anomalyco/opentui/commit/6143b9cd5fb2020e224949556ea2d7853eb0316d) fix(react/examples): import createRoot from package ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/react/examples/text.tsx` (+1 -1) </details> ### 📄 Description The `text.tsx` example for React imported `createRoot` from `"../src"` instead of referencing the `"@opentui/react"` package like in other examples. --- ## Other imports in the same directory All other `.tsx` files under `packages/react/examples` import `createRoot` using the `@opentui/react` package name, instead of a relative path ([GitHub search](https://github.com/search?q=repo%3Aanomalyco%2Fopentui%20import%20createRoot%20path%3Apackages%2Freact%2Fexamples&type=code)). ## Reusing this example/demo script This relative import worked if the example was used from within this repo, but it prevented this demo file from being used separately: ```shell curl -s https://raw.githubusercontent.com/anomalyco/opentui/main/packages/react/examples/text.tsx > text.tsx bun install @opentui/react @opentui/core react bun run ./text.tsx ``` This fails with: ```none error: Cannot find module '../src' from '/private/tmp/import-repro/text.tsx' Bun v1.3.10 (macOS arm64) ``` ## After this fix ```shell curl -s https://raw.githubusercontent.com/nicolasff/opentui/text-example-import/packages/react/examples/text.tsx > text.tsx bun install @opentui/react @opentui/core react bun run ./text.tsx ``` (works as expected) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 09:42:29 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#1546
No description provided.