Is there any way to transform strings with useTransform?
See original GitHub issueI didn’t find it anywhere in the docs, so I’m asking it here. How do you combine some CSS filter, for example, invert, with useViewportScroll
and useTransform
hook? I noticed that you can put only numbers in useTransform
and not filter strings like invert(0)
. When I try to add filters I get:
Error: 'invert(0)' is not an animatable color. Use the equivalent color code instead.
This is code that replicates the error: https://codesandbox.io/s/dry-butterfly-m888o
Is there some alternative to this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top Results From Across the Web
useTransform | Framer for Developers
Create a new motion value that transforms the output of one or more other motion values. useTransform is the primary way to compose...
Read more >framer-motion
1, import { MotionValue } from "../value";. 2, import { TransformOptions } from "../utils/transform";. 3, export declare type InputRange = number[];.
Read more >Java String transform() Method: 2 Real-Life Examples
Java String transform() method is used to apply a function to this string. The function should accept a single string argument and return...
Read more >Framer Motion — Animation Hooks
We can use the useMotionTemplate hook to combine multiple motion values into one using a template string literal. The useTransform hook lets us...
Read more >How to convert an instance of std::string to lower case
tolower() ), since you need to put the characters in a new string. Would you use transform() and something like std::bind1st( std::mem_fun() )...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@crn1 I made your example work by using the first form of
useTransform
that takes just aTransformer<T>
as a (second) argumentHi,
This was closed but the solution is more of a workaround… And the issue also exists with
transform()
, which doesn’t have the overload which takes a function as a second argument.The problem seems to be in this file,
color.test
returns true even when the string doesn’t actually describe a color. I’m not sure how to fix it. Any ideas?