From de12f97c7c282778456f314e7ef6141c5fde3bdc Mon Sep 17 00:00:00 2001 From: melloware Date: Wed, 12 Jul 2023 17:38:04 -0400 Subject: [PATCH] #4602: Add NONCE to inline style --- components/lib/hooks/useStyle.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/lib/hooks/useStyle.js b/components/lib/hooks/useStyle.js index 5d70466892..462a206f64 100644 --- a/components/lib/hooks/useStyle.js +++ b/components/lib/hooks/useStyle.js @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState } from 'react'; +import { useContext, useEffect, useRef, useState } from 'react'; import PrimeReact, { PrimeReactContext } from '../api/Api'; import { DomHandler } from '../utils/Utils'; @@ -7,7 +7,7 @@ let _id = 0; export const useStyle = (css, options = {}) => { const [isLoaded, setIsLoaded] = useState(false); const styleRef = useRef(null); - const context = React.useContext(PrimeReactContext); + const context = useContext(PrimeReactContext); const defaultDocument = DomHandler.isClient() ? window.document : undefined; const { document = defaultDocument, immediate = true, manual = false, name = `style_${++_id}`, id = undefined, media = undefined } = options;