score:1
Accepted answer
i see you returned a user
key in your container, therefore your data will be accessible via your this.props.user
prop in your component.
just make sure you add something like this to your container:
export default foocontainer = createcontainer(() => {
const subscription = meteor.subscribe("userdata");
subscription.ready() ? session.set("dataready", true) : session.set("dataready", false);
return {
user: meteor.user()
};
}
and in your render method:
render() {
if(session.get("dataready")){
return (<div>{ /* this.data.user ??? */ }</div>);
}
}
trust me, it will save you a lot of headache and a lot of errors in the future. this will make sure your data is 100% ready before it's called and rendered in your component.
oh, also assuming you have autopublish removed, publish the particular user's data in order to subscribe to it like i showed above:
meteor.publish("userdata", function(){
return meteor.users.find({_id: this.userid});
});
just a heads up.
Source: stackoverflow.com
Related Query
- Get data from a reactive container
- how to get data from react-meteor-data container only when it's ready?
- How get data from material-ui TextField, DropDownMenu components?
- Get object data and target element from onClick event in react js
- How to get the data from React Context Consumer outside the render
- ReactJS - get json object data from an URL
- React TypeScript get Data Attribute From Click Event
- How can I get data from a local file into my React app?
- How to get data from JSON with Axios?
- How to get form data from input fields in React
- Gatsby + Markdown: How to get data from a specific markdown file into a single page?
- How can i get postmessage data from react?
- react-query: how to get the data from useQuery in onSuccess callback?
- How to Pass input Field Data from Modal to the Container in react-Native?
- Draft.js. How to get all entities data from the ContentState
- How do I access data returned from an axios get to display on a web page using react js?
- Get data from express with fetch
- How to get data from local json file using actions and axios.get() (Redux)?
- Axios can not GET json data from another localhost
- How to get the response data from promise in React?
- How to send data from dialog back to parent container with react?
- How to get updated data from apollo cache
- How can I get dynamic data from within gatsby-config.js?
- How to get the data from excel in JSON format in ReactJS?
- How to fetch data in getInitialProps with redux-saga.Then get the response from redux store while in the getInitialProps method?
- React Context : Get Data from API and call API whenever some events happens in React Component
- NextJS: Get data from local storage in getInitialProps method
- ES6/React "this" keyword with ajax to get data from server (tutorial)
- ReactJS: get data from api and map data
- Passing API data from parent container to child component in React
More Query from same tag
- React.js: How to pass onchange value of listbox to function?
- React Native Responsive Font Size
- Rendering multiple states one after the other using .map
- How to prevent white text from CSS file from appearing in rendered React app?
- How to add php on a nextjs project on a specific folder or route
- React Component with JSON Image path
- Mapping through Object that is passed to child as props
- Uncaught Invariant Violation: Rendered more hooks than during the previous render
- How to validate material ui TextField in reactjs?
- How to properly pass functions as props to child component in React?
- Prevent child state resets on props change
- Pass props to an axios get request
- Update state on search query in Ant Design AutoComplete
- input type datetime-local value doesn't change if default value is set
- Avoid adding unnecessary dependencies to useEffect
- ReactJS Fixed-Data-Table and Async JSON for DataListStore
- Redux store Not re-rendring the component
- How to pass redux state to sub routes?
- Using a key property from object in TypeScript
- How to make an icon spin in React
- how to change a styled component's before content on hover [emotion.js , styled components ]
- How to remove table row on click in reactjs?
- Can not provide/test saga when using a reselect selector
- How can I set a class to the parent element if the child contains certain class?
- Get props value in method react/redux
- useState value is one step behind in reactjs
- Laravel + React, consume api with Laravel authentication
- How to determine if user is scrolling through choices of Material-UI Autocomplete with arrow keys?
- React useState await for state to be set
- Use NGinx reverse proxy for create-react-app