
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
react-resolver
Advanced tools
Isomorphic library to lazy-load data for React components
Checkout the examples!
This project is undergoing eager, active development :)
static.resolve
$ npm install --save react-resolver
var Resolver = require('react-resolver');
var UserView = React.createClass({
statics: {
resolve: {
// Return a Promise
user: function() {
return UserStore.find(this.getParams().userId);
},
// or use a Callback
user: function(done) {
request.get(`/users/${this.getParams().userId}`, done);
}
}
},
...
});
<Route />
Assuming you're using React Router, you'll need to wrap your routes
to maintain context
:
var resolver = require('resolver').create();
var routes = resolver.route(require('./routes'));
This makes it possible for your statics.resolve
props to access
Router.State
, Router.Navigation
, and other contexts.
var resolver = require('resolver').create();
var routes = resolver.route(require('./routes'));
Router.run(routes, function(Handler) {
resolver.handle(Handler).then(function(resolved) {
// On the Client
React.render(resolved, document.getElementById('app'));
// on the Server
res.send(React.renderToStaticMarkup(resolved));
});
});
v0.0.2 (2015-02-18)
FAQs
Async-rendering & data-fetching for universal React applications
The npm package react-resolver receives a total of 2,857 weekly downloads. As such, react-resolver popularity was classified as popular.
We found that react-resolver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.