DOCUMENTATION: Mention TypeScript support and update example in React docs (#2263)

This commit is contained in:
catloversg
2025-07-23 03:25:00 +07:00
committed by GitHub
parent 1ac95144be
commit 85094d4fb4
3 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -50,7 +50,7 @@
- [Learn to program](programming/learn.md)
- [Remote API](programming/remote_api.md)
- [Game frozen or stuck?](programming/game_frozen.md)
- [React](programming/react.md)
- [TypeScript and React](programming/typescript_react.md)
- [Tools & Resources](help/tools_and_resources.md)
- [Changelog](changelog.md)
- [Changelog - Legacy v1](changelog-v1.md)
@@ -1,6 +1,8 @@
# How to use React in game
# How to use TypeScript and React in game
Since v2.7.0, Bitburner supports React and TypeScript out of the box. You can use the jsx syntax inside `.jsx` and `.tsx` files.
Bitburner supports TypeScript and React out of the box.
You can write TypeScript scripts in `.ts` files and use the jsx syntax inside `.jsx` and `.tsx` files. You can run them with the `run` CLI as if they are normal JS files. For example, you can run the `timer.tsx` file in the next section by running `run timer.tsx` in the terminal tab.
## Example
@@ -22,7 +24,7 @@ function Timer() {
}
export async function main(ns: NS) {
ns.tail();
ns.ui.openTail();
ns.printRaw(<Timer />);
await ns.asleep(10000);
}