Generation

generate functionSun, 13 Nov 2022

A react component that adds 2 numbers from text inputs

import React from 'react'; type Props = {}; type State = { a: number, b: number }; export default class App extends React.Component<Props, State> { state = { a: 0, b: 0 }; render() { return ( <div> <input /> <input /> <button>Add</button> </div> ); } }

TypeScript
Generate More

Questions about programming?Chat with your personal AI assistant