Solyza
Solyza

Reputation: 85

React JS How to disable zoom

Im building a web app and I want to disable the zoom with 2 fingers. I have tried this

meta name="viewport" content=" width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"

but is not working. The app will run on tablets.

Thank you !

Upvotes: 7

Views: 14062

Answers (1)

morpet
morpet

Reputation: 125

With the React-Helmet you can put your metadata in the render-function of your Component like this:

render(){ 
    return <div>
        <Helmet>
              <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
        </Helmet>
        [...]
    </div>
}

Look at the Helmet documentation for further information.

Upvotes: 8

Related Questions