Skip to content

Commit

Permalink
fix: add useEffect to set newMirrorName
Browse files Browse the repository at this point in the history
  • Loading branch information
sutterj committed Jun 13, 2024
1 parent 649c539 commit 07f6ad9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/components/dialog/EditMirrorDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Box, FormControl, Label, Link, Text, TextInput } from '@primer/react'
import { Stack } from '@primer/react/lib-esm/Stack'
import { Dialog } from '@primer/react/lib-esm/drafts'

import { useState } from 'react'
import { useEffect, useState } from 'react'

interface EditMirrorDialogProps {
orgLogin: string
Expand Down Expand Up @@ -32,6 +32,10 @@ export const EditMirrorDialog = ({
// set to the current mirror name for display purposes
const [newMirrorName, setNewMirrorName] = useState(mirrorName)

useEffect(() => {
setNewMirrorName(mirrorName)
}, [mirrorName, setNewMirrorName])

if (!isOpen) {
return null
}
Expand Down

0 comments on commit 07f6ad9

Please sign in to comment.