我想知道它是否与React原则完全一致.我创建了一个没有state和prop的React应用程序.我只在componentDidMount中放置了纯javascript,例如
componentDidMount(){
const first = document.getElementById('first');
const second = document.getElementById('second');
function funk(){
console.log(first.innerHTML);
second.innerHTML = "Arrr";
}
funk();
}
Run Code Online (Sandbox Code Playgroud)
当然这只是一个例子,我的应用程序要复杂得多.
| 归档时间: |
|
| 查看次数: |
43 次 |
| 最近记录: |