---
type: note
kind: Recipe
tags: ['react', 'ui', 'confirm', 'react-confirm', 'react-confirm-alert']
status: release
ctime: 2023-05-14
mtime: 2024-03-22
generated: { by: human:cbcruk, at: 2024-03-28T21:31:27Z }
verified: { by: claude/opus-5, at: 2026-08-19T00:00:00Z }
sources:
  - id: github-haradakunihiko-react-confirm
    resource: https://github.com/haradakunihiko/react-confirm/tree/master
  - id: github-ga-mo-react-confirm-alert
    resource: https://github.com/GA-MO/react-confirm-alert/tree/master
---

```js
const root = createRoot('#confirm-root')

root.render(<Confirm />)
```

confirm ui를 만들다보면 `window.confirm`을 호출하는 방식으로 사용하는게 가장 좋은 방법인데 (안그러면 `state`로 관리해야하고 결국 이건 무의미한 코드의 반복이다.)
이걸 react로 구현하려면 결국 render를 사용해야함. *react-confirm*, *react-confirm-alert* 둘다 소스를 보면 비슷한 방식으로 접근한다.

- https://github.com/haradakunihiko/react-confirm/tree/master
- https://github.com/GA-MO/react-confirm-alert/tree/master