将JSX注入到React Native组件中

时间:2018-07-14 04:07:21

标签: reactjs react-native jsx

如何将JSX动态注入(并渲染)到React Native组件中?

例如,ajax调用返回:

<div class="ctrl-holder ctrl-readonly ">
<label class="label">Registration status &amp; expiry date:</label>
<div class="display"> Current - 28/05/2019</div>
</div>

假设还注入了此功能:

<div class="ctrl-holder ctrl-readonly ">
<label class="label">Vehicle:</label>
<div class="display"> 2010 SILVER HOLDEN SEDAN</div>
</div>
<div class="ctrl-holder ctrl-readonly ">
<label class="label">VIN/Chassis:</label>
<div class="display"> fwetwet45345345</div>
</div>
<div class="ctrl-holder ctrl-readonly ">
<label class="label">Engine number:</label>
<div class="display"> 63453t45645</div>
</div>
<div class="ctrl-holder ctrl-readonly ">
<label class="label">Registration serial number:</label>
<div class="display"> 6456456</div>
</div>
<div class="ctrl-holder ctrl-readonly ">
<label class="label">Compliance plate date:</label>
<div class="display"> 11/2010</div>

目的是创建动态的,用户生成的布局,这些布局可以在React Native中原生生成(并响应)。关于方向的任何指导也将不胜感激。干杯!

0 个答案:

没有答案