Skip to content

Commit d213671

Browse files
committed
update example and fix
1 parent 72ce396 commit d213671

File tree

3 files changed

+115
-2
lines changed

3 files changed

+115
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
- Prevent setUser from causing infinite loops inside use effect without passing in the dependencies. Thanks to @cdimitroulas
11+
812
## [0.2.6] - 2023-12-11
913

1014
- handle info = undefined correctly (Thanks @roguesherlock)

example/app/user/page.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22
import Image from 'next/image'
3-
import React from 'react'
3+
import React, { useEffect } from 'react'
44
import { BaselimeErrorBoundary, useBaselimeRum } from '@baselime/react-rum';
55

66

@@ -29,7 +29,11 @@ export default function Home() {
2929
}
3030

3131
function UserProfile({ }) {
32-
const { sendEvent } = useBaselimeRum();
32+
const { sendEvent, setUser } = useBaselimeRum();
33+
34+
useEffect(() => {
35+
setUser("2pi3j3")
36+
})
3337
return <button onClick={() => sendEvent("User Profile Clicked", {
3438
name: "John Doe",
3539
email: "yeyy@clickme.com"

example/package-lock.json

Lines changed: 105 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)