File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
refactor/src/components/Product Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import LoadingSpinner from '@/components/LoadingSpinner/LoadingSpinner.component
17
17
const SingleProduct = ( { product } : any ) => {
18
18
const [ isLoading , setIsLoading ] = useState < boolean > ( true ) ;
19
19
const [ selectedVariation , setSelectedVariation ] = useState < string > ( ) ;
20
+ let DESCRIPTION_WITHOUT_HTML
20
21
21
22
useEffect ( ( ) => {
22
23
setIsLoading ( false ) ;
@@ -41,10 +42,12 @@ const SingleProduct = ({ product }: any) => {
41
42
}
42
43
43
44
// Strip out HTML from description
44
- const DESCRIPTION_WITHOUT_HTML = new DOMParser ( ) . parseFromString (
45
+ if ( process . browser ) {
46
+ DESCRIPTION_WITHOUT_HTML = new DOMParser ( ) . parseFromString (
45
47
description ,
46
48
'text/html'
47
49
) . body . textContent ;
50
+ }
48
51
49
52
const placeholderFallBack = 'https://via.placeholder.com/600' ;
50
53
You can’t perform that action at this time.
0 commit comments