B
B
balex7772021-11-25 14:51:58
JavaScript
balex777, 2021-11-25 14:51:58

How to open a form in a new window in React without browser blocking the popup?

There is a form

const ref = useRef<HTMLFormElement>(null);

  useEffect(() => {
    ref?.current?.submit();
  });

  return (
    <form action="https://google.com/contact" method="POST" target="_blank" ref={ref}>


When it renders, a sambit occurs, but chrome and mozilla require permission for pop-ups on the site.
How to bypass to open without permission?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question