0
My .js file is:-無法找到.jsx之間真正的區別和js文件
var React = require('react');
export default class AmortizationChart extends React.Component {
render() {
var items = this.props.data.map(function (year, index) {
return (
<tr key={index}>
<td>{index + 1}</td>
<td className="currency interest">{Math.round(year.interestY).toLocaleString()}</td>
<td className="currency">{Math.round(year.balance).toLocaleString()}</td>
</tr>
);
});
Now same I can Write also in .jsx file.So what is the difference which file I sould take .js or .jsx?
你可以在這裏找到一個很好的答案:http://stackoverflow.com/questions/27887678/react-js-what-extension-to-use-jsx-or-just-js –
這只是約定。 – pawel