7

I'm building a web app and I want to disable zooming with multi-touch. I have tried this

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

but it's not working. How can I implement this? The app will run on tablets.

1 Answer 1

9

With 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.

Sign up to request clarification or add additional context in comments.

2 Comments

So does this go on the index.html after doing create react app?
I don't know exactly what you mean with "after create react app". You can put the <Helmet>-tag directly to your render() function in the component class. So it is after creating the react app and before the build.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.