@liveblocks/react 1.0.2-test3 → 1.0.2-test5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +17 -8
  2. package/dist/index.js +12 -8
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -21,7 +21,8 @@
21
21
  </a>
22
22
  </p>
23
23
 
24
- A set of [React](https://reactjs.org/) hooks and providers to use [Liveblocks](https://liveblocks.io) declaratively.
24
+ A set of [React](https://reactjs.org/) hooks and providers to use
25
+ [Liveblocks](https://liveblocks.io) declaratively.
25
26
 
26
27
  ## Installation
27
28
 
@@ -31,25 +32,33 @@ npm install @liveblocks/client @liveblocks/react
31
32
 
32
33
  ## Documentation
33
34
 
34
- Read the [documentation](https://liveblocks.io/docs) for guides and API references.
35
+ Read the [documentation](https://liveblocks.io/docs) for guides and API
36
+ references.
35
37
 
36
38
  ## Examples
37
39
 
38
- Explore our [collaborative examples](https://liveblocks.io/examples) to help you get started.
40
+ Explore our [collaborative examples](https://liveblocks.io/examples) to help you
41
+ get started.
39
42
 
40
- > All examples are open-source and live in this repository, within [`/examples`](../../examples).
43
+ > All examples are open-source and live in this repository, within
44
+ > [`/examples`](../../examples).
41
45
 
42
46
  ## Releases
43
47
 
44
- See the [latest changes](https://github.com/liveblocks/liveblocks/releases) or learn more about [upcoming releases](https://github.com/liveblocks/liveblocks/milestones).
48
+ See the [latest changes](https://github.com/liveblocks/liveblocks/releases) or
49
+ learn more about
50
+ [upcoming releases](https://github.com/liveblocks/liveblocks/milestones).
45
51
 
46
52
  ## Community
47
53
 
48
- - [Discord](https://discord.gg/X4YWJuH9VY) - To get involved with the Liveblocks community, ask questions and share tips.
49
- - [Twitter](https://twitter.com/liveblocks) - To receive updates, announcements, blog posts, and general Liveblocks tips.
54
+ - [Discord](https://liveblocks.io/discord) - To get involved with the Liveblocks
55
+ community, ask questions and share tips.
56
+ - [Twitter](https://twitter.com/liveblocks) - To receive updates, announcements,
57
+ blog posts, and general Liveblocks tips.
50
58
 
51
59
  ## License
52
60
 
53
- Licensed under the Apache License 2.0, Copyright © 2021-present [Liveblocks](https://liveblocks.io).
61
+ Licensed under the Apache License 2.0, Copyright © 2021-present
62
+ [Liveblocks](https://liveblocks.io).
54
63
 
55
64
  See [LICENSE](../../LICENSE) for more information.
package/dist/index.js CHANGED
@@ -127,15 +127,19 @@ function createRoomContext(client) {
127
127
  shouldInitiallyConnect: frozen.shouldInitiallyConnect
128
128
  })
129
129
  );
130
+ const isFirstRender = React2.useRef(true);
130
131
  React2.useEffect(() => {
131
- setRoom(
132
- client.enter(roomId, {
133
- initialPresence: frozen.initialPresence,
134
- initialStorage: frozen.initialStorage,
135
- unstable_batchedUpdates: frozen.unstable_batchedUpdates,
136
- withoutConnecting: frozen.shouldInitiallyConnect
137
- })
138
- );
132
+ if (!isFirstRender.current) {
133
+ setRoom(
134
+ client.enter(roomId, {
135
+ initialPresence: frozen.initialPresence,
136
+ initialStorage: frozen.initialStorage,
137
+ unstable_batchedUpdates: frozen.unstable_batchedUpdates,
138
+ withoutConnecting: frozen.shouldInitiallyConnect
139
+ })
140
+ );
141
+ }
142
+ isFirstRender.current = false;
139
143
  return () => {
140
144
  client.leave(roomId);
141
145
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liveblocks/react",
3
- "version": "1.0.2-test3",
3
+ "version": "1.0.2-test5",
4
4
  "description": "A set of React hooks and providers to use Liveblocks declaratively. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index.js",
@@ -20,8 +20,8 @@
20
20
  "test:watch": "jest --silent --verbose --color=always --watch"
21
21
  },
22
22
  "dependencies": {
23
- "@liveblocks/client": "1.0.2-test3",
24
- "@liveblocks/core": "1.0.2-test3",
23
+ "@liveblocks/client": "1.0.2-test5",
24
+ "@liveblocks/core": "1.0.2-test5",
25
25
  "use-sync-external-store": "^1.2.0"
26
26
  },
27
27
  "peerDependencies": {