This is my state
constructor(props) {
super(props);
this.state = {
fToC: '',
And this is my function
handleChange = async (value) => {
this.setState({ value });
await Axios.get(`http://dataservice.accuweather.com/`).then((res) => {
this.setState({ weather: res.data });
console.log('weather_Temperature:' + this.state.weather.DailyForecasts[0].Temperature.Maximum.Value);
>>>>>> function FToC(fahrenheit) { <<<<<<<<<<<<<<<
let fTemp = fahrenheit;
let fToCel = (fTemp - 32) * 5 / 9;
let message = fTemp + '\xB0F is ' + fToCel + '\xB0C.';
console.log('message' + message);
} FToC(this.state.weather.DailyForecasts[0].Temperature.Maximum.Value);
this.setState({ FToC })
And here I want to return the result of the function
<p class="card-text">{this.state.FToC}</p>
The Error:
Warning: Functions are not valid as a React child. This may happen if you return a Component instead of from render. Or maybe you meant to call this function rather than return it.