initial commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import * as React from "react";
|
||||
|
||||
export function App() {
|
||||
return <h1 className="text-3xl">Hello world!</h1>;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
export class AssertionError extends Error {
|
||||
constructor(msg?: string) {
|
||||
super(msg);
|
||||
this.name = "AssertionError";
|
||||
}
|
||||
}
|
||||
|
||||
export function assert(
|
||||
condition: unknown,
|
||||
message?: string,
|
||||
): asserts condition {
|
||||
if (Boolean(condition)) return;
|
||||
const parts = ["assertion failed", message].filter(
|
||||
(v) => v !== undefined,
|
||||
);
|
||||
throw new AssertionError(parts.join(": "));
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import * as React from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { App } from "./app";
|
||||
import { assert } from "./lib/assert";
|
||||
|
||||
import "./style.pcss";
|
||||
|
||||
const root = document.getElementById("root");
|
||||
assert(root, "document doesn't contain any #root element");
|
||||
|
||||
createRoot(root).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>,
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
@import "tailwindcss";
|
||||
Reference in New Issue
Block a user