I'm increasingly making complex Framer prototypes with multiple versions reusing the same components. Seems like a prime time to componentize my code. This seems like something that Framer—a code-based prototyping tool, of all things—should be great at.
But I've had headaches trying to figure out how to componentize things in Framer classes because writing Framer classes seems to require a fundamentally different structure than writing normal Framer layers. Like, I can do it, but it doesn't seem worth the effort. I usually just give up. And when I look at the source for (for example) ScrollComponent, it's scarily complex - even for someone like myself with a solid CS background.
Meanwhile, I really like React's functional component framework. Because components in React are simply functions, I can build everything as a big block of code and gradually separate it out into separate components simply by moving the code around. And because components are simply functions, I can create "higher order components" that apply a behavior (similar to Framer's ScrollComponent.wrap) to an existing components - simply by using the same API. This makes it easy to separate out concerns of presentation and behavior into separate components.
Has anyone else been thinking about how to better modularize Framer components? Especially curious if there are any other Framer users who have experience with React, and whether you think it's feasible to apply some of React's design patterns to Framer code.