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

fix: use class primarily and skip className if preact/compat is imported #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

riywo
Copy link

@riywo riywo commented Jul 29, 2021

preact/compat changes className to a synonym of class.
Thus, we only need this setup when preact/compat isn't imported.

This change fixes failure when preact/compat is used and the component is re-rendered. Close #20

Testings

Confirmed this worked with https://codesandbox.io/s/rrjq1?file=/public/index.js locally with workspace of this package.

If you want to see the working fix, I can update the code sandbox.

preact/compat changes `className` to a synonym of `class`.
Thus, we only need this setup when preact/compat isn't imported.
@planted-sam
Copy link

@sastan @danielweck @eldain @Trugamr are y'all still the active maintainers and can this PR be merged? I'm encountering the same issue as @riywo did where twind is trying to set the className and gets a TypeError. Would love if this fix could be merged in.

@planted-sam
Copy link

Ah actually I retract this statement, I tried running the modified library and it did not fix my issue. Got the fix when I removed my imports of React components from a diff library unrelated to twind. So this likely does not need to be merged?

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