And this is my NewEvent.tsx
file
import { Dispatch, SetStateAction, useState } from 'react'
import { Sheet, Text } from 'tamagui'
interface NewEventProps {
open: boolean
onOpenChange: Dispatch<SetStateAction<boolean>>
}
export const NewEvent = ({ open, onOpenChange }: NewEventProps) => {
const [position, setPosition] = useState(0)
return (
<Sheet
open={open}
onOpenChange={onOpenChange}
animation="medium"
forceRemoveScrollEnabled={open}
snapPoints={[85, 50, 25]}
snapPointsMode="percent"
dismissOnSnapToBottom
defaultPosition={0}
position={position}
zIndex={100_000}
native={true}
modal={true}
onPositionChange={setPosition}>
<Sheet.Overlay />
<Sheet.Handle />
<Sheet.Frame>
<Text>HELLO</Text>
</Sheet.Frame>
</Sheet>
)
}
And this is my tamagui.config file
import { createFont, createTamagui, createTokens } from 'tamagui'
import { createAnimations } from '@tamagui/animations-css'
import { config as defaultConfig } from '@tamagui/config/v3'
const size = {
0: 0,
1: 5,
2: 10,
true: 10,
}
export const tokens = createTokens({
size,
space: { ...size, '-1': -5, '-2': -10 },
radius: { 0: 0, 1: 3 },
zIndex: { 0: 0, 1: 100, 2: 200 },
color: {
white: '#FFFFFF',
surface: '#FAFAF7',
green: '#6D9773',
greenDark: '#465E46',
greenLight: '#DFECDF',
yellow: '#FFDD82',
red: '#CC4545',
grayDark: '#242424',
gray: '#6E6E6E',
grayLight: '#EAEAEA',
black: '#000',
},
})
const config: any = createTamagui({
defaultConfig,
animations: createAnimations({
fast: {
damping: 20,
mass: 1.2,
stiffness: 250,
},
medium: {
damping: 10,
mass: 0.9,
stiffness: 100,
},
slow: {
damping: 20,
stiffness: 60,
},
}),
fonts: {
heading: createFont({
family: 'SoraSemiBold',
size: {
1: 12,
},
}),
body: createFont({
family: 'NotoSans',
size: {
1: 12,
},
}),
},
tokens,
themes: {
light: {
bg: '#f2f2f2',
color: tokens.color.black,
},
dark: {
bg: '#111',
color: tokens.color.white,
},
},
})
type AppConfig = typeof config
declare module 'tamagui' {
interface TamaguiCustomConfig extends AppConfig {}
}
export default config
I’m using tamagui version:
"tamagui": "^1.96.0"