) => {
e.preventDefault()
setEmailLoading(true)
const res = await fetch('/api/subscribe', {
body: JSON.stringify({
- email: subscribeInputRef.current.value,
+ email: subscribeInputRef?.current?.value ?? '',
}),
headers: {
'Content-Type': 'application/json',
@@ -147,7 +176,10 @@ export default function Roadmap({ features, ip }) {
}
toast.success('You are now subscribed to feature updates!')
- subscribeInputRef.current.value = ''
+
+ if (subscribeInputRef.current) {
+ subscribeInputRef.current.value = ''
+ }
}
return (
@@ -189,7 +221,7 @@ export default function Roadmap({ features, ip }) {
- {data.features.map((feature, index) => (
+ {data.features.map((feature: Feature, index: number) => (