Skip to content

Support multiple JSX Frameworks at the same time #836

@JohnDeved

Description

@JohnDeved

Description

Supporting multiple JSX frameworks at the same time can be useful in cases like Astro.

Problem Statement/Justification

I have a component written in React and another in Solid, displayed on the same page using Astro.
I would still like to use Panda JSX components in both Frameworks.
Right now it's only easily possible to have the JSX components work for eighter react or solid, not both at the same time.

Proposed Solution or API

allow the jsxFramework config option to accept arrays aswell

export default defineConfig({
	// [...]
	jsxFramework: ["react", "solid"]
})

then generate folder structure like so:
styled-system/react-jsx
styled-system/solid-jsx

usage would then look like this:

// solid
import { Box } from "../styled-system/solid-jsx"

export default function Solid() {
  return <Box bg="green">Hello from Solid</Box>
}
// react
import { Box } from '../styled-system/react-jsx'

const React: React.FC = () => {
  return <Box bg="blue">Hello from React</Box>
}
export default React

Alternatives

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions