mirror of
https://github.com/Raghu-Ch/ReactWeather.git
synced 2026-02-10 03:03:01 -05:00
29 lines
587 B
JavaScript
29 lines
587 B
JavaScript
var React = require('react');
|
|
|
|
// var WeatherMessage = React.createClass({
|
|
// render: function () {
|
|
// var {temp, location} = this.props;
|
|
//
|
|
// return (
|
|
// <h3>It's it {temp} in {location}.</h3>
|
|
// )
|
|
// }
|
|
// });
|
|
|
|
// Refactoring stateless function
|
|
|
|
// var WeatherMessage = (props) => {
|
|
// var {temp, location} = props;
|
|
// return (
|
|
// <h3>It's it {temp} in {location}.</h3>
|
|
// )
|
|
// };
|
|
// (or)
|
|
var WeatherMessage = ({temp, location}) => {
|
|
return (
|
|
<h3 className="text-center">It's it {temp} in {location}.</h3>
|
|
)
|
|
};
|
|
|
|
module.exports = WeatherMessage;
|