如何从标签中获取ReactElement?

时间:2016-03-05 18:06:52

标签: reactjs react-native

PanResponder方法传递的ResponderSyntheticEvent nativeEvent.target是一个React标记(只是Number)。这与findNodeHandle返回的标记相同。

有没有办法从React代码中获取ReactElement

修改

我可以使用ReactNativeTagHandles.tagToRootNodeID[tag]来获取“根节点ID”。现在我如何从中获得ReactElement

1 个答案:

答案 0 :(得分:0)

$query=mysqli_query($link,"SELECT * FROM dl_commfactory_2 LIMIT 35");
while($row = mysqli_fetch_array($query)){
    $dlid = $row['DL_Id'];
    $brandid = $row['Brand_Id'];
    ?>
    <tr>
    <td><input type="text" name="dlid" readonly value="<?php echo $dlid; ?>" size="2"></td>     
    <td><input type="text" name="brandid" value="<?php echo $brandid; ?>" list="brandlist" id="output" onkeyup="searchbrand()" >
    <datalist id="brandlist" name="taskoption">
        <option> </option>
    </datalist> </td>
    <?php } ?>

仅适用于facebook/react &gt; = 15.0.2

的版本

您可以看到var ReactNativeComponentTree = require('ReactNativeComponentTree'); var reactInstance = ReactNativeComponentTree.getInstanceFromNode(reactTag); 已定义here