Skip to content

Commit

Permalink
primefaces#4602: Add NONCE to inline style
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Jul 12, 2023
1 parent 2f479cd commit de12f97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/lib/hooks/useStyle.js
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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;
Expand Down

0 comments on commit de12f97

Please sign in to comment.