I am trying to use Reactjs with a kendo separator. A splitter has a style attribute like
style="height: 100%"
If I correctly understood everything in Reactjs, this can be implemented using the inline style
var style = { height: 100 }
However, I also use Dustin Getz jsxutil to try to split the parts into parts and get independent HTML snippets. At the moment, I have the following HTML snippet (splitter.html)
<div id="splitter" className="k-content"> <div id="vertical"> <div> <p>Outer splitter : top pane (resizable and collapsible)</p> </div> <div id="middlePane"> {height} <div id="horizontal" style={height}> <div> <p>Inner splitter :: left pane</p> </div> <div> <p>Inner splitter :: center pane</p> </div> <div> <p>Inner splitter :: right pane</p> </div> </div> </div> <div> <p>Outer splitter : bottom pane (non-resizable, non-collapsible)</p> </div>
and the splitter.js component, which references this HTML as follows
define(['react', 'external/react/js/jsxutil','text!internal/html/splitter.html'], function(React, jsxutil, splitterHtml) { 'use strict'; console.log('in app:' + splitterHtml); return React.createClass({ render: function () { var scope = { height: 100 }; console.log('about to render:' + scope.height); var dom = jsxutil.exec(splitterHtml, scope); console.log('rendered:' + dom); return dom; } }); } )
Now when I run this, I can see the height correctly if I put it as content. However, when it is executed as style properties, I get an error
The 'style' prop expects a mapping from style properties to values, not a string.
So I obviously didnβt quite match it.
I would really appreciate if anyone could help me fix this.
javascript html reactjs
Simon Woods Feb 03 '14 at 18:30 2014-02-03 18:30
source share