Skip to content

dialog 다이어로그 속성에 open 넣어주기! #100

Description

@0gunkim

useState를 활용해서 넣어줬습니다.
특이점 스프레드 연산자를 사용해서 넣고 open 벨류를 true를 넣는다는 점

const [isOpen, setIsOpen] = useState(false);
.
.
.

<dialog {...(isOpen && true ? { open: true } : {})} id="favDialog">
        <form method="dialog">
.
.
.
.
.

<button id="confirmBtn" value="default" onClick={modalHandler}>
   확인
</button>

</dialog>

Metadata

Metadata

Assignees

Labels

NEWS새로배운 것들

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
🐽 Tip

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions