liveblog
liveblog copied to clipboard
Adding <span> tag crashes React app
1 Click Text tab
2 Enter <span style="color: red;">hello</span> world
3 Click Visual Tab
React app disappears from screen — all entries are gone.
Console shows:
app.js?ver=1.8.0:14 Error: Minified React error #62; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=62&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at r (app.js?ver=1.8.0:14)
at rn (app.js?ver=1.8.0:14)
at ln (app.js?ver=1.8.0:14)
at finalizeInitialChildren (app.js?ver=1.8.0:22)
at completeWork (app.js?ver=1.8.0:14)
at n (app.js?ver=1.8.0:14)
at i (app.js?ver=1.8.0:14)
at a (app.js?ver=1.8.0:14)
at s (app.js?ver=1.8.0:14)
at w (app.js?ver=1.8.0:14)
at b (app.js?ver=1.8.0:14)
at batchedUpdates (app.js?ver=1.8.0:14)
at Z (app.js?ver=1.8.0:14)
at De (app.js?ver=1.8.0:14)
u @ app.js?ver=1.8.0:14
s @ app.js?ver=1.8.0:14
w @ app.js?ver=1.8.0:14
b @ app.js?ver=1.8.0:14
batchedUpdates @ app.js?ver=1.8.0:14
Z @ app.js?ver=1.8.0:14
De @ app.js?ver=1.8.0:14
The full text of the error is:
The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.
@jasonagnew Is this something you're able to take a look at? I confirmed it locally.
@philipjohn @jasonagnew This is likely related to this https://github.com/Automattic/liveblog/blob/master/src/react/Editor/convertFromHTML.js#L23. Text element attributes need to be mapped from HTML attributes to props that React understand.
Our version (which uses TinyMCE) avoids this problem.