the-bugging / react-use-hotjar Goto Github PK
View Code? Open in Web Editor NEWAdds Hotjar capabilities as custom hooks such as init, identify and stateChange
Home Page: https://www.npmjs.com/package/react-use-hotjar
License: MIT License
Adds Hotjar capabilities as custom hooks such as init, identify and stateChange
Home Page: https://www.npmjs.com/package/react-use-hotjar
License: MIT License
Hi there! My team is considering your library but can't currently use it due to lack of page events API.
In SPAs it's often desired and sometimes necessary to nofify Hotjar about route events.
Do you plan to support any wrapper for the following:
hj('stateChange', relativePath)
?
Is your feature request related to a problem? Please describe.
I think it will be better if hotjar debug feature is included in this library. I don't see any option to enable it.
Describe the solution you'd like
Hotjar provides a debug feature that you can enable in the hotjar script. I think we can add that as a parameter to this function
More on Debug Feature here
Additional context
I am just curious why this is excluded in the library. Is there any particular reason?
In nextjs, I have a cookie consent banner, where I want to initialize tracking (including hotjar), after an onClick.
However, it seems that with nextjs and hotjar, it needs to be initialized in useEffect()
. Is there any way to initialize hotjar after an onclick event?
Describe the bug
Broken sourcemaps add noise to create-react-app v5 output:
Compiled with warnings.
Failed to parse source map from '/path/cra-react-use-hotjar/node_modules/react-use-hotjar/src/dependencies.ts' file: Error: ENOENT: no such file or directory, open '/path/cra-react-use-hotjar/node_modules/react-use-hotjar/src/dependencies.ts'
Failed to parse source map from '/path/cra-react-use-hotjar/node_modules/react-use-hotjar/src/index.ts' file: Error: ENOENT: no such file or directory, open '/path/cra-react-use-hotjar/node_modules/react-use-hotjar/src/index.ts'
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
assets by status 9.52 KiB [cached] 2 assets
assets by status 1.49 MiB [emitted]
assets by chunk 1.49 MiB (name: main)
asset static/js/bundle.js 1.48 MiB [emitted] (name: main) 1 related asset
asset main.77f586b74a9aca0e9655.hot-update.js 4.58 KiB [emitted] [immutable] [hmr] (name: main) 1 related asset
assets by path *.json 699 bytes
asset asset-manifest.json 671 bytes [emitted]
asset main.77f586b74a9aca0e9655.hot-update.json 28 bytes [emitted] [immutable] [hmr]
asset index.html 1.67 KiB [emitted]
Entrypoint main 1.49 MiB (1.51 MiB) = static/js/bundle.js 1.48 MiB main.77f586b74a9aca0e9655.hot-update.js 4.58 KiB 3 auxiliary assets
cached modules 1.37 MiB [cached] 107 modules
runtime modules 31.4 KiB 15 modules
./src/App.js 2.68 KiB [built] [code generated]
WARNING in ./node_modules/react-use-hotjar/dist/index.es.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/cra-react-use-hotjar/node_modules/react-use-hotjar/src/dependencies.ts' file: Error: ENOENT: no such file or directory, open '/path/cra-react-use-hotjar/node_modules/react-use-hotjar/src/dependencies.ts'
@ ./src/App.js 8:0-41 14:2-11 63:10-19
@ ./src/index.js 7:0-24 11:33-36
WARNING in ./node_modules/react-use-hotjar/dist/index.es.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/path/cra-react-use-hotjar/node_modules/react-use-hotjar/src/index.ts' file: Error: ENOENT: no such file or directory, open '/path/cra-react-use-hotjar/node_modules/react-use-hotjar/src/index.ts'
@ ./src/App.js 8:0-41 14:2-11 63:10-19
@ ./src/index.js 7:0-24 11:33-36
2 warnings have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
webpack 5.69.0 compiled with 2 warnings in 136 ms
To Reproduce
Steps to reproduce the behavior:
npx create-react-app cra-use-hotjar
cd cra-use-hotjar
npm i react-use-hotjar
useHotjar()
to src/App.js
npm start
Additional context
facebook/create-react-app#11767 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.