Comments (9)
@rushilshah1 just released with version 1.4.0. 😉
from react-giphy-searchbox.
wohoo! Thanks @sergiop!
from react-giphy-searchbox.
Hi @rushilshah1, what's the purpose of managing the search text via prop instead of letting the user set it through the input field? Do you need to set a default query on component initialization?
from react-giphy-searchbox.
@sergiop - It is more for accessing the user query outside of the react-giphy-searchbox component. Similar to the onSelect
callback which returns a Gif object, if that or some other prop could return the search query it can be used/displayed outside of the react-giphy-searchbox component.
from react-giphy-searchbox.
@rushilshah1 ah... ok! I've completely misunderstood your request, sorry. 🙂
Nice idea, we can call it onSearch
and it will receive the searched text as a parameter, like this.
onSearch={
text => console.log('Searched text', text)
}
What do you think?
from react-giphy-searchbox.
@sergiop sounds good to me! Thank you 😄
from react-giphy-searchbox.
@rushilshah1 I just added the feature in this PR, it was pretty simple. Please feel free to give it a try leaving your feedback. In the meantime maybe I can write some tests to run inside the CI.
from react-giphy-searchbox.
@sergiop Appreciate the quick turnaround! What would be the easiest way for me to try it out since it is not a new package version on npm just yet?
from react-giphy-searchbox.
To test:
Way 1:
you can fork or simply clone this repo, check out the feature/on-search-callback
branch, run yarn install
and yarn start
. Once the project is running, you can open the demo page on http://localhost:3000/, adding the new callback on demo/src/index.js
.
Way 2 (maybe simpler):
if you have already installed this library on a project, change your package.json
from this:
"dependencies": {
"react-giphy-searchbox": "^1.3.0"
}
to this:
"dependencies": {
"react-giphy-searchbox": "git+ssh://[email protected]:sergiop/react-giphy-searchbox.git#62ad4e4"
}
(where #62ad4e4
is the hash related to the changes I just made) and run yarn install
or npm install
.
Otherwise, if you can wait a couple of days, I'll release the feature! 😉
from react-giphy-searchbox.
Related Issues (20)
- README.md: project logo broken on npmjs.com
- Remove Axios.
- Production API Key HOT 2
- Autofocus the searchbox prop HOT 3
- Attribution & Giphy Guidelines HOT 7
- sped up / blurry gif? HOT 3
- Specify a hundred percent width to the component HOT 1
- Module parse failed: Unexpected character '�' during yarn build HOT 2
- [Bug] Cannot read property 'total_count' of undefined HOT 17
- CSS Modules cannot be imported from within node_modules HOT 3
- Add typescript types
- Duplicate component keys HOT 1
- Usage in existing form component HOT 1
- How to make the component fully responsive with screen size
- Uncaught ReferenceError: module is not defined
- Don't nest search input in form HOT 2
- Update npm package with last fix
- Outdated react peer dependencies cause issues
- Package not installing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-giphy-searchbox.