Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solid component doesn't render correctly #2

Open
geohuz opened this issue Dec 20, 2023 · 0 comments
Open

Solid component doesn't render correctly #2

geohuz opened this issue Dec 20, 2023 · 0 comments

Comments

@geohuz
Copy link

geohuz commented Dec 20, 2023

The viteconfig.ts:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import jsxRefresh from "@vitejs/plugin-react-refresh"
import { narrowSolidPlugin } from "@merged/react-solid/plugin"

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react(), narrowSolidPlugin({ include: /\/src\/solid/ }), jsxRefresh({exclude: /\/src\/solid\//}) ],
})

App.jsx

import { Solid } from '@merged/react-solid'
import { Dot }  from './solid/Dot.jsx'

function App() {
  return (
      <Solid
        component={Dot}
        id={"abc"}
        x={19}
        y={5} />
  )
}

export default App

solid/Dot.jsx

import { spring } from "motion";
import { Motion } from "@motionone/solid";
import { mapScale, springConfig } from '../constants'

export function Dot(props) {
  return (
      <Motion>
        style={{
          width: '20px',
          height: '20px',
          background: "#ff6d6c",
          "border-radius": '50%'
        }}
        animate={{
          x: mapScale.width(props.x),
          y: mapScale.height(props.y)
        }}
        transition={{
          easing: spring(springConfig) 
        }}
      >
        <span>RID:{props.id}</span>
      </Motion>
  )
}

The App renders something as below:

style=[object Object]animate=[object Object]transition=[object Object]>RID:abc

anything could've been wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant