-
-
Notifications
You must be signed in to change notification settings - Fork 220
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
Unable to use AutoAnimate in Solid.js project following documentation example #121
Comments
Am able to work around this issue with the following. Notably, import { createSignal, For, Show } from "solid-js"
import { createAutoAnimateDirective } from "@formkit/auto-animate/solid"
import "./index.css"
export default function Drawer() {
// Required to prevent TS from removing the directive
const autoAnimate = createAutoAnimateDirective()
const menuItems = ["Home", "Settings", "Logout"]
const [isExpanded, setIsExpanded] = createSignal(true)
return (
<div class="parent" use:autoAnimate>
<Show when={isExpanded()} keyed>
<ul class="drawer">
<For each={menuItems}>{(item) => <li class="item">{item}</li>}</For>
</ul>
</Show>
<div class="content">
<button
class="button button--alt"
type="button"
onClick={() => setIsExpanded((isExpanded) => !isExpanded)}
>
Toggle Drawer
</button>
</div>
</div>
)
} |
I'm using v1.0.0-beta.6 and yeah the example of usage in the documentation is not working both with The |
Thanks, this helped me a lot! |
update solid examples to fix #121
Discord user
sigma
is unable to get AutoAnimate working in their solid.js project following our examples in the docs.reproduction repo here: https://github.com/awojciak/autoanimate-repro
Example is in
./src/components/Drawer.tsx
The text was updated successfully, but these errors were encountered: