nlincoln / react-qparams Goto Github PK
View Code? Open in Web Editor NEWManage your url query params with a render prop!
License: MIT License
Manage your url query params with a render prop!
License: MIT License
Now that we can set the values in the url programmatically, it would be good to be able to have links that incorporate a query
prop.
Ex:
// url: /foo?a=b
<QueryLink query={{ b: 'c' }} > Children </QueryLink>
Would render:
<a href="/foo?a=b&b=c"> Children </a>
Now that we have both QueryParams
and QueryLink
, it would make sense to remove the default export.
This is a simple change, but it's a breaking one that I want to remove before 1.0
I was thinking something like
<QueryParams>
{query => <button onClick={() => query.replaceQuery({ a: 'b' })}>click</button>
</QueryParams>
This one is a little bit more complicated, because query-string
allows for arrays of values. That said, it only allows for arrays of primitives like numbers and strings, and doesn't support arrays of arrays.
With that in mind, it should be possible to compare the given query params with the query params in the url, and apply the active class if needed
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.