My web application is created by React Native Web with react-navigator.
react-navigator sets RouteName as document.title in default.
ex.
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="root" component={RootScreen} />
<Stack.Screen name="search" component={SearchScreen} />
</Stack.Navigator>
generates
...
<head>
<title>root</title>
...
What I want
Changing document.title on demand.
What I tried but not works
try to access document object directly, but below code does not works.
export default function RootScreen({ navigation }) {
useEffect(() => {
document.title = `My Web App | ${someMessage}`
})