Giter VIP home page Giter VIP logo

Comments (5)

gadfly361 avatar gadfly361 commented on May 30, 2024

@hoopes Thanks for the detailed issue, much appreciated!

from soda-ash.

gadfly361 avatar gadfly361 commented on May 30, 2024

@hoopes Please try this

   [sa/Tab
    {:renderActiveOnly false
     :panes
     [
      {:menuItem "Tab1"
       :pane
       {:key "tab1"
        :content
        (reagent/as-element [:span "Tab 1 content"])}
       }

      {:menuItem "Tab2"
       :pane
       {:key "tab2"
        :content
        (reagent/as-element [:span "Tab 2 content"])}
       }
      ]
     }]

from soda-ash.

hoopes avatar hoopes commented on May 30, 2024
(ns my-ns
  (:require [reagent.core :as r]
            [soda-ash.core :as sa]))

(defn- tab-content [some-obj]
  [sa/TabPane (str "Tab content! - " (:title @some-obj))])

(defn main-panel [some-obj]
  [sa/Tab
   {:renderActiveOnly false
    :panes [
            {:menuItem "Tab"
             :pane {:key "tab1"
                    :content (r/as-element [tab-content some-obj]) }}]}])

This did indeed work! So the as-element was needed b/c the react-semantic-ui expects react elements, but my previous try was...just reagent elements? Sorry, I'm just getting started with cljs. Is the :> thing not the same as as-element?

In any case, your help is super-appreciated, and this lib is great, thanks for it! Please feel free to close the issue, if you like.

from soda-ash.

gadfly361 avatar gadfly361 commented on May 30, 2024

@hoopes the :> is syntactic sugar for adapt-react-class which is close, but not quite the same thing. The difference is one is for a react component and the other is for a react element.

I haven't read this post, so forgive me if it is useless, but after a quick google search I found this:
https://tylermcginnis.com/react-elements-vs-react-components/

from soda-ash.

gadfly361 avatar gadfly361 commented on May 30, 2024

@hoopes I am going to close the issue, but feel free to ping me at clojurians slack in the #reagent channel. If you haven't you can sign up here: http://clojurians.net/

from soda-ash.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.