We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
I would really appreciate some help on this.
The Problem A change in document causes components displaying other documents to re-render as well.
Expected behavior Only the component displaying the affected document should re-render.
Steps to recreate
The Setup
Publication server/publications/schedules.js
server/publications/schedules.js
... Meteor.publish('schedules.list', function schedulesList() { ... return Schedules.find(); }); ...
Container client/modules/schedules/containers/list.js
client/modules/schedules/containers/list.js
import { useDeps, composeAll, composeWithTracker, compose } from 'mantra-core'; import List from '../components/list.jsx'; export const composer = ({ context }, onData) => { const { Meteor, Collections } = context(); if (Meteor.subscribe('schedules.list').ready()) { const schedules = Collections.Schedules.find().fetch(); onData(null, { schedules }); } }; export const depsMapper = (context, actions) => ({ context: () => context, }); export default composeAll( composeWithTracker(composer), useDeps(depsMapper) )(List);
List Component client/modules/schedules/components/list.jsx
client/modules/schedules/components/list.jsx
import React from 'react'; import Item from './item.jsx'; const List = ({ schedules = [] } = {}) => ( <div> {schedules.map((schedule) => ( <Item schedule={schedule} key={schedule._id} /> ))} </div> ); export default List;
Item Component client/modules/schedules/components/item.jsx
client/modules/schedules/components/item.jsx
import React from 'react'; import { ... } from 'react-bootstrap'; const Item = ({ schedule = {} }) => ( <div> ... </div> ); export default Item;
The text was updated successfully, but these errors were encountered:
i've the same issue
Sorry, something went wrong.
Yep. This will be fixed in 2.x - #123
Awesome, @arunoda! :)
Launched v2. Check the Performance section.
No branches or pull requests
Hello,
I would really appreciate some help on this.
The Problem
A change in document causes components displaying other documents to re-render as well.
Expected behavior
Only the component displaying the affected document should re-render.
Steps to recreate
The Setup
Publication
server/publications/schedules.js
Container
client/modules/schedules/containers/list.js
List Component
client/modules/schedules/components/list.jsx
Item Component
client/modules/schedules/components/item.jsx
The text was updated successfully, but these errors were encountered: