Skip to content

Commit

Permalink
update example and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankcorn committed Dec 22, 2023
1 parent 72ce396 commit d213671
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

- Prevent setUser from causing infinite loops inside use effect without passing in the dependencies. Thanks to @cdimitroulas

## [0.2.6] - 2023-12-11

- handle info = undefined correctly (Thanks @roguesherlock)
Expand Down
8 changes: 6 additions & 2 deletions example/app/user/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'
import Image from 'next/image'
import React from 'react'
import React, { useEffect } from 'react'
import { BaselimeErrorBoundary, useBaselimeRum } from '@baselime/react-rum';


Expand Down Expand Up @@ -29,7 +29,11 @@ export default function Home() {
}

function UserProfile({ }) {
const { sendEvent } = useBaselimeRum();
const { sendEvent, setUser } = useBaselimeRum();

useEffect(() => {
setUser("2pi3j3")
})
return <button onClick={() => sendEvent("User Profile Clicked", {
name: "John Doe",
email: "[email protected]"
Expand Down
105 changes: 105 additions & 0 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d213671

Please sign in to comment.