Commit ee5d8ca
authored
fix(suspensive.org/Sandpack): exclude custom props from 'SandpackPreview' spread to prevent DOM warnings (#1953)
# Overview
- Destructure custom props (`layout`, `showConsole`,
`showConsoleButton`) from `previewOptions` before spreading to
`SandpackPreview`
- These props are not part of `PreviewProps` but were passed to the DOM
via `{...props.previewOptions}`, causing React warnings:
- `showConsoleButton` prop on a DOM element
- `showConsole` prop on a DOM element
## Screenshot
### AS-IS
<img width="1725" height="939" alt="image"
src="https://github.com/user-attachments/assets/154ac894-6583-4936-886f-e339f3a05b9e"
/>
<img width="1727" height="943" alt="image"
src="https://github.com/user-attachments/assets/5ca2a958-d762-4691-bcc0-aeed366edc48"
/>
<img width="1728" height="942" alt="image"
src="https://github.com/user-attachments/assets/58cb5088-ca16-4124-83d7-00ae5601ef5c"
/>
### TO-BE
<img width="1724" height="939" alt="image"
src="https://github.com/user-attachments/assets/a4cb8d82-2727-408f-8a40-f2f485354adf"
/>
## PR Checklist
- [x] I did below actions if need
1. I read the [Contributing
Guide](https://github.com/toss/suspensive/blob/main/CONTRIBUTING.md)
2. I added documents and tests.1 parent a9603df commit ee5d8ca
1 file changed
Lines changed: 12 additions & 8 deletions
Lines changed: 12 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
28 | 38 | | |
29 | 39 | | |
30 | 40 | | |
31 | 41 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 42 | + | |
35 | 43 | | |
36 | 44 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
152 | 156 | | |
153 | 157 | | |
154 | 158 | | |
155 | | - | |
| 159 | + | |
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
| |||
0 commit comments