This package contains components which are not part of the core tamagui framework. You find the installation for Tamagui here
# yarn add @tamagui-extras/core
Add @tamagui-extras/core
to the config section of your next.config.js
file.
withTamagui({
config: './tamagui.config.ts',
components: ['tamagui', '@tamagui-extras/core'],
// the rest of your config
})
Important: if you bump into compile issues you might have to add the package also to the transpileModule
section.
Have a look of the NextJS config -see example
require('next-transpile-modules')(
[
'solito',
'react-native-web',
'expo-linking',
'expo-constants',
'expo-modules-core',
'@tamagui-extras/core'
// the rest of the config
]
)
Everytime you face the situation that an error message appears similar
to SyntaxError: Cannot use import statement outside a module
you might use an node module which is not transpiled for
web.
All components are prefixed with Lm
to have an easy identifier which component belongs to this package.
import {LmAlert} from "@tamagui-extras/core";
import {YStack} from 'tamagui'
function MyApp() {
return (
<YStack space>
<LmAlert text={"My alert message"}/>
</YStack>
)
}