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