Skip to content

Commit d5b05cd

Browse files
committed
Add note about message serialization.
1 parent e44709d commit d5b05cd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ const MyComponent = () => (
9696
- `updatedAt` {Date} when the last message or error was received
9797
- `postMessage` {Function} sends a message to the Web Worker
9898

99+
> Note: [it's recommended](https://nolanlawson.com/2016/02/29/high-performance-web-worker-messages/) to send and receive
100+
> JSON strings instead of JS objects for improved performance. `<WebWorker>` can't do this for you, so you'll have to
101+
> stringify and parse message data yourself if you care about performance.
102+
99103
## Examples
100104

101105
### Using `lastPostAt` to show a loading indicator

0 commit comments

Comments
 (0)