dbwcooper / react-ctrl-f Goto Github PK
View Code? Open in Web Editor NEWUsing react to realize web Ctrl + F function
Home Page: https://react-ctrl-f.vercel.app
Using react to realize web Ctrl + F function
Home Page: https://react-ctrl-f.vercel.app
在MatchText组件中,当searchValue为空字符串的时候,修改textStr,组件不更新
Using MatchText raises invalid hook call error.
Code
import React, { useContext } from "react";
import { Link } from "react-router-dom";
import {
MatchText,
SearchProvider,
SearchContext,
SearchEventContext,
} from "react-ctrl-f";
export default function Home() {
return (
<>
<div>Home</div>
<MatchText id='match-text-id-1'>Hello world</MatchText>
</>
);
}
As soon as i remove MatchText. Everything works fine. Am i missing something?
Versions using:
"react-ctrl-f": "^0.0.4"
"react": "^18.1.0"
Hi, it's a great project ! Congratulations ! But... When I try it on my app (it's absolutely the same code as your src/pages folder) it's working but I have the following error : "invalid hook call" which is very strange because there is nowhere an invalid hook call in your code. Of course, it's impossible to push in production (I use Vercel as well).
Maybe some have an idea about how to fix it ?
Thanks in advance for the reply !
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.