Skip to content

Commit

Permalink
Fix "window is not defined" in component
Browse files Browse the repository at this point in the history
  • Loading branch information
Marvin Heilemann committed Jan 23, 2020
1 parent cf0e876 commit e7389a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "marvin-digital",
"version": "3.11.0",
"version": "3.11.1",
"private": true,
"description": "Portfolio of and by Marvin Heilemann (@muuvmuuv)",
"repository": {
Expand Down
9 changes: 6 additions & 3 deletions src/components/HideContent.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React from 'react'
import { useState } from 'react'
import React, { useState, useEffect } from 'react'

/* eslint-disable jsx-a11y/no-interactive-element-to-noninteractive-role */

const HideContent = ({ text }) => {
const [state, setState] = useState(btoa(text))
const [state, setState] = useState(null)

useEffect(() => {
setState(window.btoa(text))
}, [text])

const decryptContent = () => {
setState(text)
Expand Down

0 comments on commit e7389a7

Please sign in to comment.