How to create bindings for @Emotion/styled

Hi. I’m trying to learn how bindings work and more specifically bindings to @Emotion.styled

For example the following in JS:

import styled from '@emotion/styled';

const Wrapper = styled.div``

Looking at How to bind to Framer Motion style (motion.div) components - #2 by kevanstannard for inspiration I tried to bind it in ReScript:

module Styled = {
  @module("@emotion/styled") @scope("default") @react.component
  external div: React.element = "div"
}

However it did not work.

Thankful for any clues and answers!

In short, I’m not aware of any safe way to do it, but check this thread: Binding to Tagged template function

Thank you! Yes it seems, from that thread, to be something on the radar.

Would you mind telling me the unsafe ways? If they’re manageable.

Thanks!

You’d probably have to use %raw:
https://rescript-lang.org/try?code=DYUwLgBA7gTghgBwSGEC8ECk8oAoBEAzmAJ6gAmAdOQJYBuABg-gJRA

I understand. Thank you!