1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-22 06:53:25 +02:00

Add key prop to <br /> elements in html-serializer (#1704)

This commit is contained in:
nschlehe
2018-03-21 21:15:29 +01:00
committed by Ian Storm Taylor
parent 6678245fba
commit 8689c671f6

View File

@@ -54,7 +54,7 @@ const TEXT_RULE = {
serialize(obj, children) { serialize(obj, children) {
if (obj.object === 'string') { if (obj.object === 'string') {
return children.split('\n').reduce((array, text, i) => { return children.split('\n').reduce((array, text, i) => {
if (i != 0) array.push(<br />) if (i != 0) array.push(<br key={i} />)
array.push(text) array.push(text)
return array return array
}, []) }, [])