Skip to content

Instantly share code, notes, and snippets.

@assertchris
Last active Dec 22, 2020
Embed
What would you like to do?
// in component...
import React from "react"
const Comments = () => {
if (typeof document != 'undefined') {
return (
<div>...</div>
)
}
if (typeof navigator != 'undefined' && navigator.product == 'ReactNative') {
const { View } = require("react-native")
return (
<View>...</View>
)
}
}
// in web...
<div>
<Comments />
</div>
// in app...
<View>
<Comments />
</View>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment