Skip to content

Commit 570155d

Browse files
committed
fix redeclaration of variable in formula calculation
1 parent d1c8e65 commit 570155d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/react-notion-x/src/third-party/property.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { Text } from '../components/text'
1010
import { PageTitle } from '../components/page-title'
1111
import { GracefulImage } from '../components/graceful-image'
1212
import { evalFormula } from './eval-formula'
13+
import { FormulaResult } from 'notion-types'
1314

1415
export interface IPropertyProps {
1516
propertyId?: string
@@ -76,10 +77,10 @@ export const PropertyImpl: React.FC<IPropertyProps> = (props) => {
7677
const renderFormulaValue = React.useMemo(
7778
() =>
7879
function FormulaProperty() {
79-
let content: string
80+
let content: FormulaResult | null
8081

8182
try {
82-
let content = evalFormula(schema.formula, {
83+
content = evalFormula(schema.formula, {
8384
schema: collection?.schema,
8485
properties: block?.properties
8586
})

0 commit comments

Comments
 (0)