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

Zdog support seems to be broken since v9 #1665

Closed
AurelienDud opened this issue Aug 20, 2021 · 6 comments
Closed

Zdog support seems to be broken since v9 #1665

AurelienDud opened this issue Aug 20, 2021 · 6 comments
Labels
kind: bug Something isn't working
Milestone

Comments

@AurelienDud
Copy link

🐛 Bug Report

I'm trying to use React-Spring with Zdog.
But the syntax <a.Shape /> (or any other Zdog component) throw these errors:

<Shape /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.

The tag <Shape> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.

To Reproduce

The Zdog's official example use React-Spring 8.0.21.
Increase the React-Spring version beyond v9 will reproduce the issue.
Add the package @react-spring/zdog doesn't solve the problem.

Expected behavior

No syntaxe error

Link to repro (highly encouraged)

A simple reproduction example:
https://codesandbox.io/s/react-spring-zdog-issue-9g0e2

The official Zdog's codesandbox example:
https://codesandbox.io/s/nervous-feather-vk9uh

Environment

I tried various combinations of packages versions but that always fail from React-Spring v9.
The problem seems not to be related to the Zdog or React-Zdog version in use.

@joshuaellis
Copy link
Member

I've never really use Zdog, I imagine the target came in as a contribution so equally we would need someone else who knows zDog to resolve this issue. If you're interested in looking at it, then i'm happy to support you where ever I can! 👍🏼

@joshuaellis joshuaellis added the kind: bug Something isn't working label Aug 20, 2021
@AurelienDud
Copy link
Author

Ok, I'll take a look for myself and try to contact the Zdog team as well.
Thank you

@joshuaellis
Copy link
Member

If you need anything @AurelienDud, just ask! 😄

@AurelienDud
Copy link
Author

If you need anything @AurelienDud, just ask! 😄

@joshuaellis I just saw in the code that you are the official maintainer 😄
I still don't know how the React-Spring project is structured so any help and hints could help me

@AurelienDud
Copy link
Author

@joshuaellis i got the problem!

In @react-spring/zdog a list of Zdog primitives is defined as an array of strings according Zdog component names..

const primitives = [ 'Anchor', 'Rect', ... ]

But a string is not suitable to let @react-spring/animated create a custom React element.
This list of primitives have to be defined as an object of Zdog React components.

const primitives = { Anchor: reactZdog.Anchor, Rect: reactZdog.Rect, ... }

I attach a quick patch to this message:
@react-spring+zdog+9.2.4.patch.md

@joshuaellis joshuaellis added this to the v9.3.0 milestone Sep 19, 2021
@joshuaellis
Copy link
Member

i've released a beta v9.2.5-beta.0, let me know if this resolves your issue 💪🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants