File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ const Stopwatch = Resource(({ on }) => {
28
28
// #endregion stopwatch
29
29
30
30
// #region component
31
- import { use } from "@starbeam/react " ;
31
+ import { use } from "@starbeam/preact " ;
32
32
33
33
export const Clock = ( ) => {
34
34
// #highlight:next
35
- const time = use ( ( ) => Stopwatch , [ ] ) ;
35
+ const time = use ( Stopwatch ) ;
36
36
37
37
return < div > { time ?? "now" } </ div > ;
38
38
} ;
Original file line number Diff line number Diff line change 6
6
7
7
<Demo :config =" resources " />
8
8
9
- Start by installing the React renderer into your app.
9
+ Start by installing the Preact renderer into your app.
10
10
11
11
``` npm
12
12
@starbeam/preact @starbeam/universal @starbeam/js
@@ -20,12 +20,12 @@ This is the most basic way to use Starbeam in a Preact app.
20
20
21
21
## The ` use ` Hook
22
22
23
- The ` @starbeam/react ` renderer also includes a ` use ` hook, which allows you to attach
24
- Starbeam resources into a React app. Resources are instantiated when the component is mounted, and
23
+ The ` @starbeam/preact ` renderer also includes a ` use ` hook, which allows you to attach
24
+ Starbeam resources into a Preact app. Resources are instantiated when the component is mounted, and
25
25
cleaned up when the component is unmounted.
26
26
27
27
To get an idea for how it works, we'll integrate the Stopwatch resource from the [ Guides] ( /guides/fundamentals/resources ) section
28
- into React .
28
+ into Preact .
29
29
30
30
As a quick refresher, here's what the resource looks like:
31
31
You can’t perform that action at this time.
0 commit comments