Skip to content

Commit 9b8039e

Browse files
committed
doc: fix example error.
1 parent 49de404 commit 9b8039e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,13 @@ export default function Demo() {
324324
}}
325325
>
326326
<JsonView.String
327-
render={({ children, ...reset }, { type }) => {
328-
const isImg = /^https?.*\.(jpg|png)$/i.test(children)
327+
render={({ children, ...reset }, { type, value, keyName }) => {
328+
const isImg = /^https?.*\.(jpg|png)$/i.test(value)
329329
if (type === 'type' && isImg) {
330330
return <span />
331331
}
332332
if (type === 'value' && isImg) {
333-
return <img {...reset} height="26" src={children} />
333+
return <img {...reset} height="26" src={value} />
334334
}
335335
}}
336336
/>

0 commit comments

Comments
 (0)