NativeBase comes with its very own Strict Mode that lets you control the level of strictness for your App and Dev environment. A really handy tool to maintain best practices throughout your codebase.
Strict Mode is a config that you pass into NativeBase config. It takes 3 values - error, warn and off. By default, it is set to warn. Based on your chosen option, it checks for every prop in your project. It checks if you have used proper token values from the theme and if you are only passing string values to the props. If not, then it throws an error or warning, or does nothing.
error - Choosing this mode will show an error indicating the cause of the error.
warn - Choosing this mode will show a warning indicating the issue.
off - Choosing this mode simply means you want to go rogue and not follow the design system and best practices.
To change the strictMode create a config object like below and choose you strictMode value from error, warn and off which ever suits your use-case :
import { INativebaseConfig, NativeBaseProvider } from 'native-base';
const config: INativebaseConfig = {
strictMode: 'warn',
};
and pass this as a prop in your App NativeBaseProvider
<NativeBaseProvider config={config}>
<App />
</NativeBaseProvider>