Cannot render nested data returned by UseTracker in Meteor - ReactJS

Asked
Active3 hr before
Viewed126 times

7 Answers

returnedusetrackermeteornestedreactjscannotrender
90%

Connect and share knowledge within a single location that is structured and easy to search.,I have a functional component that gets data using UseTracker(). The data returned is a single 'Wine' object and an array of related 'Recipe' objects (the join is done in the publication). Both object types have nested arrays and objects within them:, I want to build an all metal, self-designed building. Are metal frame and joists really that infeasible?

 Pretag team - issue, fix, solve, resolve
88%

e.g.

renderApples() {
  return this.props.apples.map((apple) => (
    <Apple key={apple._id}
        apple={apple}
        oranges={Oranges.find({appleId: apple._id}).fetch()} />
  ));
}
load more v
72%

https://github.com/meteor/react-packages/blob/master/packages/react-meteor-data/useTracker.ts#L117,Your example might be a little too contrived - why are you using setState from within useTracker?,The issue occurred in 2.2.2. The issue not exists in 2.1.4.

import React, { useState } from 'react';
import { useTracker } from 'meteor/react-meteor-data';

export const App = () => {
  const [s, setS] = useState(false);
  useTracker(() => {
    //to trigger rerender
    setS(true);
  }, []);

  const links = useTracker(() => [], []);

  //BUG, because the 'links' must always be 'array'
  if (links === undefined) {
    console.error(`links === undefined`);//for 2d render it equals undefined
  }

  return (
    <div>
      <h2>Links count:{links.length}</h2>
    </div>
  );
};
load more v
65%

 Pretag team - issue, fix, solve, resolve
75%

meteor create --react app and --typescript now use useTracker hook instead of withTracker HOC, it also uses function components instead of classes.,The server-render package now supports passing a Stream object to ServerSink methods that previously expected a string, which enables streaming server-side rendering with React 16:,The spiderable package now reports the URL it's trying to fetch on failure.

  • Clone the package repository into your application's imports directory, make any modifications necessary, then use npm install to link the-package into node_modules:
meteor npm install imports / the - package
load more v
40%

Migrating to Meteor 1.7 , Using npm Packages , Writing npm Packages

To install React in Meteor should add it as a npm dependency:

meteor npm install--save react react - dom
load more v
22%

 Pretag team - issue, fix, solve, resolve

Other "returned-usetracker" queries related to "Cannot render nested data returned by UseTracker in Meteor - ReactJS"