Hi, can anyone point me in the right direction as to how to convert reagent 
components into a form that a react component will accept in place of a 
function that returns jsx?

The specific example I'm trying to get working is the fixed-data-table plugin 
with markup in the cells.

Here's a snippet from one of the fixed-data-table examples 
(https://github.com/facebook/fixed-data-table/blob/master/site/examples/ObjectDataExample.js)
 that does just that in plain react:

function renderLink(/*string*/ cellData) {
  return <a href="#">{cellData}</a>;
}

function renderDate(/*object*/ cellData) {
  return <span>{cellData.toLocaleString()}</span>;
}

....

        <Column
          cellRenderer={renderLink}
          label="Email"
          width={200}
          dataKey="email"
        />
        <Column
          cellRenderer={renderDate}
          label="DOB"
          width={200}
          dataKey="date"
        />

But my attempts to pass in reagent components result in either nothing or  (str 
component). Have tried reagent/reactify-component, reagent/as-element and 
reagent/as-component and various permutations thereof. So my clojurescript 
looks something like this:

(defn hello-cat
  [args]
  (pr args)
  [:span  "hello cat"])

...
(Column {:label "Foo"
               :dataKey :foo
               :cellDataGetter getter
               :cellRenderer (reagent/reactify-component hello-cat) ;; renders 
nothing
               ;; :cellRenderer (reagent/as-component hello-cat) ;; renders 
(str component)
               ;; :cellRenderer (reagent/as-element hello-cat) ;; renders (str 
component)
               ;; :cellRenderer (reagent/render-to-string hello-cat) ;; renders 
generated  html as string
               :width 50}

Any ideas?

Thanks,

Russell

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to