crazko / use-dencrypt-effect Goto Github PK
View Code? Open in Web Editor NEWA custom React hook generating crypting text effect.
License: MIT License
A custom React hook generating crypting text effect.
License: MIT License
Hi,
I'm new to react. I don't know how to run this hook.
Just I have used this as it. But the text effect is not running infinitely. Can you please help with this problem?
The effect is running only one.
Steps to reproduce
npm install --save use-dencrypt-effect
Expected result
Package.json has use-dencrypt-effect
with version 1.0.1
and uses the same API as the examples.
Actual result
Package.json has use-dencrypt-effect
with version 2.0.0-rc.1
and uses the different API than the examples.
As the method loads, the page is blank, so it looks as if it hangs. Is there a way to begin with some default text from the array before the animation begins?
Thanks
Installed with yarn add use-dencrypt-effect
, literally copied usage example and got error 'useDeEncrypt' is not defined no-undef
.
import { useDencrypt } from "use-dencrypt-effect";
is grayed out.
Your example code doesn't work in my project. Various spellings of dencrypt, deEncrypt etc.
Here is one that worked for me
import React, { useEffect } from 'react';
import { useDencrypt } from 'use-dencrypt-effect';
const values = ['test', 'test2'];
function TextTest() {
const { result, dencrypt } = useDencrypt();
useEffect(() => {
let i = 0;
const action = setInterval(() => {
dencrypt(values[i]);
i = i === values.length - 1 ? 0 : i + 1;
}, 2000);
return () => clearInterval(action);
}, []);
return (
<div>
<h1>{result}</h1>
</div>
);
}
export default TextTest;
Hi, and thank you for this really nice animation plugin.
My question (or feature request) is:
thank you in advance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.