Skip to content

Commit 6f71700

Browse files
committed
updated to JSX
1 parent 8913da9 commit 6f71700

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/playground/index.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ const CMS = () => {
2525
loadData('./data.json')
2626

2727
const ListComponent = ({ item }) =>
28-
h('div', null, h('h5', null, item.title))
28+
<Fragment>
29+
<strong>{item.title}</strong>
30+
<p>{item.id}</p>
31+
</Fragment>
32+
2933
const previewComponent = ({ value }) =>
30-
h('div', null, value.map((item, i) => h('p', { key: `item.title${i}`}, item.get('title'))))
34+
value.map((item, i) => <p key={i}>{item.get('title')}</p>)
3135

3236
const ReorderWidget = createReorderWidget({ ListComponent, previewComponent })
3337

packages/playground/static/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ collections:
4646
widget: ncw-reorder
4747
collection: posts
4848
id_field: id
49-
display_fields: ['title']
49+
display_fields: ['title', 'id']
5050

5151
- label: Setting
5252
name: setting

0 commit comments

Comments
 (0)