Skip to content

Commit 4d54cc6

Browse files
authored
fix(templates): optional chaining bug (#8268)
Another one that ts non-strict mode is not catching 🙃🫠 https://github.com/user-attachments/assets/7cf78db9-4181-4a2d-9a8e-cdf3dd4f1951
1 parent f011e4f commit 4d54cc6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/website/src/fields/slug/SlugComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const SlugComponent: React.FC<SlugComponentProps> = ({
3838
})
3939

4040
const fieldToUseValue = useFormFields(([fields, dispatch]) => {
41-
return fields[fieldToUse].value as string
41+
return fields[fieldToUse]?.value as string
4242
})
4343

4444
useEffect(() => {

0 commit comments

Comments
 (0)