score:1

Accepted answer

You can achieve it by this:-

import React from 'react'

export default class YourComponent extends React.Component {
    constructor(props) {
        super(props)
        this.state = {
            totalPrice: 0
        }
    }
    handleChange(ev){
        let totalPrice = ev.target.value * 10 // your number here i have taken 10 for example
        this.setState({totalPrice:totalPrice})
    }
    render() {
        return (
            <div>
                <input type="number" onChange={this.handleChange.bind(this)}/>
                <span>Total Price: {this.state.totalPrice}</span>
            </div>
        )
    }
}

Related Query

More Query from same tag