jQuery Apiがひどく必要ですが、私はReact jsでapiを使用しています。私はReact js Lifecyclesを混乱させるだけです。 その他の情報異なるdivのビューカウンタを作成しています。私の視点では、私はひどく、jQueryのAPIを高さを世話するscrollTopスプライトを必要とする。.. 次のコードは出力不定はjQueryとReact jsの統合方法は?
var React = require('react');
var ReactDOM = require('react-dom');
var NewsDetail = require('./news-details');
var $ = require('jquery');
module.exports = React.createClass({
getInitialState:function() {
return{
news:[
{
{
id:"5",
data:"I probably am using the wrong I probably am using the wrong terminology here but this is what I'm trying to do. I want to create a map with a value terminology here but this is what I'm trying to do. I want to create a map with a value for each key and a value for each key's object. S"
},
{
id:"6",
data:"I probably am using the wrong I probably am using the wrong terminology here but this is what I'm trying to do. I want to create a map with a value I probably am using the wrong terminology here but this is what I'm trying to do. I want to create a map with a value I probably am using the wrong terminology here but this is what I'm trying to do. I want to create a map with a value terminology here but this is what I'm trying to do. I want to create a map with a value for each key and a value for each key's object. S"
},
{
id:"7",
data:"I probably am using the wrong terminology here but this is what I'm trying to do. I want to create a map with a value I probably am using the wrong terminology here but this is what I'm trying to do. I want to create a map with a value I probably am using the wrong terminology here but this is what I'm trying to do. I want to create a map with a value for each key and a value for each key's object. S"
},
{
id:"8",
data:"I probably am using the wrong I probably am using the wrong terminology here but this is what I'm trying to do. I want to create a map with a value terminology here but this is what I'm trying to do. I want to create a map with a value for each key and a value for each key's object. S"
},
{
id:"9",
data:"I probably am using the wrong I probably am using the wrong terminology here but this is what I'm trying to do. I want to create a map with a value I probably am using the wrong terminology here but this is what I'm trying to do. I want to create a map with a value I probably am using the wrong terminology here but this is what I'm trying to do. I want to create a map with a value terminology here but this is what I'm trying to do. I want to create a map with a value for each key and a value for each key's object. S"
},
],
top:0,
height:null
}
},
componentWillMount:function() {
},
componentDidUpdate:function() {
var height = $('#newscontainer').height();
alert(height)//udefined
},
render:function() {
var newsdata = this.state.news.map(function (newss) {
return(<NewsDetail key={newss.id} {...newss}/>)
});
return(
<div className="newscontanier" id="newscontanier">{newsdata}</div>
)
}
})
をそれにもかかわらず、あなたは
のようにこれを行うことができ、その後、あなたは見つけることができますか?要素の高さを取得しているだけの場合は、jQueryを使用せずに行うことができます。 –
var height = $( '#newscontainer')。高さ();あなたのDOMによると、間違ったIDを選択しています。 ... id = "newscontanier" –
あなたのIDはあなたのレンダリング機能で間違っています。 – ray