From 404b90badc5856a74c06d04062c850003e28fed5 Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Mon, 31 Jul 2023 12:20:23 -0700 Subject: Add ecosystem guides (#3847) * Add ecosystem guides * Update titles * Rename stric * Add unlink and fetch guides * Add formdata guide * Tweak title * Moar --- docs/guides/ecosystem/react.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 docs/guides/ecosystem/react.md (limited to 'docs/guides/ecosystem/react.md') diff --git a/docs/guides/ecosystem/react.md b/docs/guides/ecosystem/react.md new file mode 100644 index 000000000..b712e210e --- /dev/null +++ b/docs/guides/ecosystem/react.md @@ -0,0 +1,30 @@ +--- +name: Use React and JSX +--- + +React just works with Bun. Bun supports `.jsx` and `.tsx` files out of the box. Bun's internal transpiler converts JSX syntax into vanilla JavaScript before execution. + +```tsx#react.tsx +function Component(props: {message: string}) { + return ( + +

{props.message}

+ + ); +} + +console.log(); +``` + +--- + +Bun implements special logging for JSX to make debugging easier. + +```bash +$ bun run react.tsx + +``` + +--- + +Refer to [Runtime > JSX](/docs/runtime/jsx) for complete documentation on configuring JSX. -- cgit v1.2.3