Skip to content

Warning: Error: Variant titleLarge was not provided properly. Valid variants are regular, medium, light, thin. #4589

Description

@ACDC5

Current behaviour

After yarn react-native run-android is run, the following error occurs:
Image

Preview

index.js

import{AppRegistry}from'react-native';import{PaperProvider}from'react-native-paper';importAppfrom'./App';
....exportdefaultfunctionMain(){return(<PaperProvidertheme={appTheme}><App/></PaperProvider>);}AppRegistry.registerComponent(appName,()=>Main)

App.js

import{View,StyleSheet,TouchableOpacity}from'react-native';import{Appbar,Text,useTheme}from'react-native-paper';
...
constcreateStyles=(theme)=>StyleSheet.create({container: {flex: 1,justifyContent: 'flex-start',backgroundColor: theme.colors.background,},});constApp=()=>{consttheme=useTheme();conststyles=createStyles(theme);const[klineData,setKlineData]=useState([]);
...
useEffect(()=>{constfetchKlineData=async()=>{try{constresponse=awaitapi.get('/lines',{});setKlineData(response);}catch(error){setError(error);}};fetchKlineData();},[]);consthandleTitlePress=()=>{};return(<Viewstyle={styles.container}><Appbar.Header><TouchableOpacityonPress={handleTitlePress}><Appbar.Contenttitle={tradingPair}/></TouchableOpacity></Appbar.Header><Textstyle={{color: theme.colors.primary}}>show data</Text></View>);};exportdefaultApp

My attempt

I tried changing the <Appbar.Content title={tradingPair} /> in app.js to the following:
<Appbar.Content title={tradingPair} titleVariant="'titleMedium'" />
But the error still exists

Environment

softwareversion
OSwindows 11
iosx
android9
react-native0.76.5
react-native-paper^5.12.5
nodev18.20.5
yarn1.22.22
expo sdkx.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions