opentui
opentui copied to clipboard
Add support for testing React components
Added support for passing a custom renderer in React render and make it wait until React commits
I added a ready field to the TestRenderer to be able to await the React commit. Because React renders asynchronously
i'm not sure on this one... i had started looking into changing the api for this previously but didn't finish it! i was leaning towards exposing a createRoot method that takes a renderer to align with standards.
Something like:
import { createCliRenderer } from "@opentui/core";
import { createRoot } from "@opentui/react";
const renderer = await createCliRenderer(<config>);
createRoot(renderer).render(<App />);
That makes sense. I also have some issues creating the promise for ready in a way that does not create issues with Solid
I think this was solved by #309