Skip to content

Commit

Permalink
Merge branch 'release/2.7.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
elgorditosalsero committed May 3, 2023
2 parents 74f4f41 + f14822f commit fb02a8f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"react"
],
"description": "Easily manage the Google Tag Manager via Hook",
"version": "2.7.1",
"version": "2.7.2",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/react-gtm-hook.esm.js",
Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Context, ReactNode, createContext, useEffect, useContext, useReducer } from 'react'

import { ISnippetsParams } from './models/GoogleTagManager'
import { ISendToGTM, ISnippetsParams } from './models/GoogleTagManager'
import { initGTM, sendToGTM } from './utils/GoogleTagManager'

declare global {
Expand Down Expand Up @@ -39,7 +39,7 @@ export const initialState: ISnippetsParams = {
* The context
*/
export const GTMContext = createContext<ISnippetsParams | undefined>(initialState)
export const GTMContextDispatch = createContext<typeof sendToGTM | undefined>(undefined)
export const GTMContextDispatch = createContext<((data: ISendToGTM['data']) => void) | undefined>(undefined)

function dataReducer(state: ISnippetsParams, data: any) {
sendToGTM({ data, dataLayerName: state?.dataLayerName! })
Expand Down
2 changes: 1 addition & 1 deletion src/models/GoogleTagManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ export type ISetupGTM = {
*/
export type ISendToGTM = {
dataLayerName: string
data: Object
data: object
}

0 comments on commit fb02a8f

Please sign in to comment.