Limitations when accessing the CMS with code

With one of our updates in the CMS, certain functionalities related to code components and overrides built on Framer internals are no longer supported.

These changes were necessary to improve performance, stability, and to enable new features, such as larger collections. The collection variable, for example, has been updated and is no longer an Array. Additionally, the properties provided by the collection variable are a private implementation detail that may change at any time.

Here’s what you can no longer do in the CMS.

Access collections with a code override

import type { ComponentType } from "react"

export function withCollection(Component): ComponentType {
    return (props) => {
        // The variable below has changed and is NOT supported.
        const collection = props.children.props.query.from.data
        return <Component {...props} />
    }
}

Access collections with a code component

import { Fragment } from "react"
import { addPropertyControls, ControlType } from "framer"

export default function Component({ children }) {
    // The variable below has changed and is NOT supported.
    const collection = children.props.children.props.query.from.data
    return <Fragment>{children}</Fragment>
}

addPropertyControls(Component, {
    children: {
        type: ControlType.ComponentInstance,
    },
})

Access collections with a module import

// The variable below has changed and is NOT supported.
import collection from "../collection/qE6RTvUxt"

These limitations ensure that Framer remains robust and flexible as the platform evolves. If you have questions or need guidance on adapting your components, feel free to explore our community resources or reach out for support.