Answers for "on close tab react native web"

0

on close tab react native web

import { Beforeunload } from 'react-beforeunload';

class Example extends React.Component {
  state = { value: '' };

  render() {
    return (
      <>
        {value !== '' && (
          <Beforeunload onBeforeunload={(event) => event.preventDefault()} />
        )}
        <input
          onChange={(event) => this.setState({ value: event.target.value })}
          value={this.state.value}
        />
      </>
    );
  }
}
Posted by: Guest on September-11-2021

Code answers related to "on close tab react native web"

Code answers related to "Javascript"

Browse Popular Code Answers by Language