The website is developed with React. When users open my website on an iPhone or an Android phone, how to show a banner to promote the user to download or use the IOS or Android app instead of the website on a browser?
Here is an example with reddit.com, when opening reddit.com on an iPhone or an Android phone, it shows a banner like these to promote the users to use the Reddit ios or android app.


On the opening of the website on the mobile browser, you can detect the device using the JS library react-device-detect.
if it's Android or iPhone/iPad you can show the banner and with the click of that button, you can use the Deeplink URLs for the android and iOS app. You can also use dynamic links if you want to send users to AppStore or Play Store.