arunoda / react-komposer

Feed data into React components by composing containers.
MIT License
733 stars 70 forks source link

How to get key value through callback on props in react komposer? #84

Open higv2000 opened 8 years ago

higv2000 commented 8 years ago

I am trying to get the key value associated with user selection on a list in dataList -- the data in dataList is populated through a container and composed through react-komposer.

In the parent component,

In the container .js file, import {composeWithTracker} from 'react-komposer'; import OrgNamesDataList from '/client/components/OrgNamesDataList.jsx'; composer = (props, onData) => { console.log("inside container composer outside -- " + props.orgName); ``` console.log("inside container composer"); const handle = Meteor.subscribe(...); if (handle.ready()) { const orgNames = orgs.find().fetch(); onData(null, {orgNames}); } ``` }; export default composeWithTracker(composer)(OrgNamesDataList); In OrgNamesDataList.jsx, import React from 'react'; const DataItem = ({dataObj}) =>(
macrozone commented 8 years ago

can you fix the code-indention? this would make it easier to read. Also there seems to be missing pieces, so I don't know exactly what the problem is.