Skip to content

Commit

Permalink
Change useEffect to useLayoutEffect when resizing
Browse files Browse the repository at this point in the history
Signed-off-by: Cédric Boirard <[email protected]>
  • Loading branch information
triozer committed Jan 13, 2025
1 parent e072460 commit ed6c44d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions starters/cms/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "./App.css"
import type { ManagedCollection } from "framer-plugin"

import { framer } from "framer-plugin"
import { useEffect, useState } from "react"
import { useEffect, useLayoutEffect, useState } from "react"
import { DataSource, getDataSource } from "./data"
import { FieldMapping } from "./FieldMapping"
import { SelectDataSource } from "./SelectDataSource"
Expand All @@ -18,7 +18,7 @@ export function App({ collection, previousDataSourceId, previousSlugFieldId }: A
const [dataSource, setDataSource] = useState<DataSource | null>(null)
const [isLoadingDataSource, setIsLoadingDataSource] = useState(Boolean(previousDataSourceId))

useEffect(() => {
useLayoutEffect(() => {
const hasDataSourceSelected = Boolean(dataSource)

framer.showUI({
Expand Down

0 comments on commit ed6c44d

Please sign in to comment.