Deploying new contract to etherium network with web3.js

I have tried to run this code with relevant dependencies to get contract address and I received an error

No "from" address specified in neither the given options, nor the default options. from the browser. Additionally, there is no error while deploying with the Remix tool by using metamask ropsten testnet.

onSubmit = async (event) => {
    this.setState({ loading: true, errorMessage: '' }); 
    try {
        const accounts = await web3.eth.getAccounts();
        await factory.methods
        .send({ from: accounts[0] })
    } catch (err) {
        this.setState({ errorMessage: err.message }) 
    this.setState({ loading: false });