Conditional Rendering inside the ComponentStyling multi-line conditions in 'if' statements?Loop inside React JSXCss animated spinner is buggy in IE on Windows 8.1 when used in a React JS componentHow to wait for AJAX response and only after that render the component?React + Semantic-UI: Using Forms inside UI MODALReact/redux + bootstrap, make modal show unique for componentReact.semantic ui's Icones are not loading with webpack middle wareChild components not rendering as expectedreact not found component always rendersReact spinner when components async content are loaded completely

What aircraft was used as Air Force One for the flight between Southampton and Shannon?

Is using 'echo' to display attacker-controlled data on the terminal dangerous?

How can I end combat quickly when the outcome is inevitable?

Is it safe to change the harddrive power feature so that it never turns off?

How can I get an unreasonable manager to approve time off?

Ability To Change Root User Password (Vulnerability?)

How is the excise border managed in Ireland?

How to decline a wedding invitation from a friend I haven't seen in years?

How does the Around command at zero work?

Bb13b9 confusion

How come the nude protesters were not arrested?

Entire circuit dead after GFCI outlet

A map of non-pathological topology?

Why we don’t make use of the t-distribution for constructing a confidence interval for a proportion?

Are there any important biographies of nobodies?

Check if three arrays contains the same element

Is it possible to have a wealthy country without a middle class?

Why can my keyboard only digest 6 keypresses at a time?

Why does Sin[b-a] simplify to -Sin[a-b]?

Longest bridge/tunnel that can be cycled over/through?

Who enforces MPAA rating adherence?

Fixing obscure 8080 emulator bug?

Is it expected that a reader will skip parts of what you write?

Is an entry level DSLR going to shoot nice portrait pictures?



Conditional Rendering inside the Component


Styling multi-line conditions in 'if' statements?Loop inside React JSXCss animated spinner is buggy in IE on Windows 8.1 when used in a React JS componentHow to wait for AJAX response and only after that render the component?React + Semantic-UI: Using Forms inside UI MODALReact/redux + bootstrap, make modal show unique for componentReact.semantic ui's Icones are not loading with webpack middle wareChild components not rendering as expectedreact not found component always rendersReact spinner when components async content are loaded completely






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I have a Semantic UI Modal in separate component and I am calling in another component. This is working fine.



If I add a if condition inside the Modal it's throwing an error.



Below is my code.



Modal.js



import React from 'react'
import Button, Icon, Modal as SemanticModal from 'semantic-ui-react'

const Modal = (trigger, header, size, dimmer, content, actions) => (
<SemanticModal
trigger=trigger
size=size
dimmer=dimmer
header=header
content=content
actions=actions
/>
)

export default Modal;


App.js



<Modal
trigger=<a>Link</a>
size='small'
dimmer='blurring'
header=result===""?"<Header icon='spinner loading'/>":"<Header content='Result' />"
content=result===""?"<p>Loading...</p>":"<p>showing the result</p>"
/>


The above one is working fine.



But the below one is not working



App.js



<Modal
trigger=<a>Link</a>
size='small'
dimmer='blurring'


publishStatus=="" ? (
header="<Header icon='spinner loading'/>"
content="Loading..."
) : (
header="<Header content='Result' />"
content="showing the result"
)



header=result===""?"<Header icon='spinner loading'/>":"<Header content='Result' />"
content=result===""?"<p>Loading...</p>":"<p>showing the result</p>"
/>


What is wrong in the above method?










share|improve this question




























    0















    I have a Semantic UI Modal in separate component and I am calling in another component. This is working fine.



    If I add a if condition inside the Modal it's throwing an error.



    Below is my code.



    Modal.js



    import React from 'react'
    import Button, Icon, Modal as SemanticModal from 'semantic-ui-react'

    const Modal = (trigger, header, size, dimmer, content, actions) => (
    <SemanticModal
    trigger=trigger
    size=size
    dimmer=dimmer
    header=header
    content=content
    actions=actions
    />
    )

    export default Modal;


    App.js



    <Modal
    trigger=<a>Link</a>
    size='small'
    dimmer='blurring'
    header=result===""?"<Header icon='spinner loading'/>":"<Header content='Result' />"
    content=result===""?"<p>Loading...</p>":"<p>showing the result</p>"
    />


    The above one is working fine.



    But the below one is not working



    App.js



    <Modal
    trigger=<a>Link</a>
    size='small'
    dimmer='blurring'


    publishStatus=="" ? (
    header="<Header icon='spinner loading'/>"
    content="Loading..."
    ) : (
    header="<Header content='Result' />"
    content="showing the result"
    )



    header=result===""?"<Header icon='spinner loading'/>":"<Header content='Result' />"
    content=result===""?"<p>Loading...</p>":"<p>showing the result</p>"
    />


    What is wrong in the above method?










    share|improve this question
























      0












      0








      0








      I have a Semantic UI Modal in separate component and I am calling in another component. This is working fine.



      If I add a if condition inside the Modal it's throwing an error.



      Below is my code.



      Modal.js



      import React from 'react'
      import Button, Icon, Modal as SemanticModal from 'semantic-ui-react'

      const Modal = (trigger, header, size, dimmer, content, actions) => (
      <SemanticModal
      trigger=trigger
      size=size
      dimmer=dimmer
      header=header
      content=content
      actions=actions
      />
      )

      export default Modal;


      App.js



      <Modal
      trigger=<a>Link</a>
      size='small'
      dimmer='blurring'
      header=result===""?"<Header icon='spinner loading'/>":"<Header content='Result' />"
      content=result===""?"<p>Loading...</p>":"<p>showing the result</p>"
      />


      The above one is working fine.



      But the below one is not working



      App.js



      <Modal
      trigger=<a>Link</a>
      size='small'
      dimmer='blurring'


      publishStatus=="" ? (
      header="<Header icon='spinner loading'/>"
      content="Loading..."
      ) : (
      header="<Header content='Result' />"
      content="showing the result"
      )



      header=result===""?"<Header icon='spinner loading'/>":"<Header content='Result' />"
      content=result===""?"<p>Loading...</p>":"<p>showing the result</p>"
      />


      What is wrong in the above method?










      share|improve this question














      I have a Semantic UI Modal in separate component and I am calling in another component. This is working fine.



      If I add a if condition inside the Modal it's throwing an error.



      Below is my code.



      Modal.js



      import React from 'react'
      import Button, Icon, Modal as SemanticModal from 'semantic-ui-react'

      const Modal = (trigger, header, size, dimmer, content, actions) => (
      <SemanticModal
      trigger=trigger
      size=size
      dimmer=dimmer
      header=header
      content=content
      actions=actions
      />
      )

      export default Modal;


      App.js



      <Modal
      trigger=<a>Link</a>
      size='small'
      dimmer='blurring'
      header=result===""?"<Header icon='spinner loading'/>":"<Header content='Result' />"
      content=result===""?"<p>Loading...</p>":"<p>showing the result</p>"
      />


      The above one is working fine.



      But the below one is not working



      App.js



      <Modal
      trigger=<a>Link</a>
      size='small'
      dimmer='blurring'


      publishStatus=="" ? (
      header="<Header icon='spinner loading'/>"
      content="Loading..."
      ) : (
      header="<Header content='Result' />"
      content="showing the result"
      )



      header=result===""?"<Header icon='spinner loading'/>":"<Header content='Result' />"
      content=result===""?"<p>Loading...</p>":"<p>showing the result</p>"
      />


      What is wrong in the above method?







      reactjs if-statement modal-dialog conditional semantic-ui






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 24 at 19:16









      DhanapalDhanapal

      71113




      71113






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Something like this ?
          Not the cleanest approach though



           <Modal
          trigger=<a>Link</a>
          size="small"
          dimmer="blurring"

          ...publishStatus === '' ?
          header: <Header icon='spinner loading'/>,
          content: 'Loading...',
          :
          header: <Header content='Result' />,
          content: 'showing the result',


          />





          share|improve this answer

























          • ya.. That works.. but i am getting an error at header tag. it's not recognized like size or dimmer. How to make the header and content to Modal attributes?

            – Dhanapal
            Mar 24 at 19:43











          • I updated the comment, I think Header should not be wrapped in commas

            – Alexandr Zavalii
            Mar 24 at 19:44











          • oh... Sorry for the confusion.. I mean the header: and content: attribute itself not recognized.

            – Dhanapal
            Mar 24 at 19:47











          • @Dhanapal sorry I dont understand. Check this example: codesandbox.io/s/wkyjk2426l?module=/example.js

            – Alexandr Zavalii
            Mar 24 at 20:12











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55327547%2fconditional-rendering-inside-the-component%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Something like this ?
          Not the cleanest approach though



           <Modal
          trigger=<a>Link</a>
          size="small"
          dimmer="blurring"

          ...publishStatus === '' ?
          header: <Header icon='spinner loading'/>,
          content: 'Loading...',
          :
          header: <Header content='Result' />,
          content: 'showing the result',


          />





          share|improve this answer

























          • ya.. That works.. but i am getting an error at header tag. it's not recognized like size or dimmer. How to make the header and content to Modal attributes?

            – Dhanapal
            Mar 24 at 19:43











          • I updated the comment, I think Header should not be wrapped in commas

            – Alexandr Zavalii
            Mar 24 at 19:44











          • oh... Sorry for the confusion.. I mean the header: and content: attribute itself not recognized.

            – Dhanapal
            Mar 24 at 19:47











          • @Dhanapal sorry I dont understand. Check this example: codesandbox.io/s/wkyjk2426l?module=/example.js

            – Alexandr Zavalii
            Mar 24 at 20:12















          0














          Something like this ?
          Not the cleanest approach though



           <Modal
          trigger=<a>Link</a>
          size="small"
          dimmer="blurring"

          ...publishStatus === '' ?
          header: <Header icon='spinner loading'/>,
          content: 'Loading...',
          :
          header: <Header content='Result' />,
          content: 'showing the result',


          />





          share|improve this answer

























          • ya.. That works.. but i am getting an error at header tag. it's not recognized like size or dimmer. How to make the header and content to Modal attributes?

            – Dhanapal
            Mar 24 at 19:43











          • I updated the comment, I think Header should not be wrapped in commas

            – Alexandr Zavalii
            Mar 24 at 19:44











          • oh... Sorry for the confusion.. I mean the header: and content: attribute itself not recognized.

            – Dhanapal
            Mar 24 at 19:47











          • @Dhanapal sorry I dont understand. Check this example: codesandbox.io/s/wkyjk2426l?module=/example.js

            – Alexandr Zavalii
            Mar 24 at 20:12













          0












          0








          0







          Something like this ?
          Not the cleanest approach though



           <Modal
          trigger=<a>Link</a>
          size="small"
          dimmer="blurring"

          ...publishStatus === '' ?
          header: <Header icon='spinner loading'/>,
          content: 'Loading...',
          :
          header: <Header content='Result' />,
          content: 'showing the result',


          />





          share|improve this answer















          Something like this ?
          Not the cleanest approach though



           <Modal
          trigger=<a>Link</a>
          size="small"
          dimmer="blurring"

          ...publishStatus === '' ?
          header: <Header icon='spinner loading'/>,
          content: 'Loading...',
          :
          header: <Header content='Result' />,
          content: 'showing the result',


          />






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 24 at 19:44

























          answered Mar 24 at 19:22









          Alexandr ZavaliiAlexandr Zavalii

          1,030924




          1,030924












          • ya.. That works.. but i am getting an error at header tag. it's not recognized like size or dimmer. How to make the header and content to Modal attributes?

            – Dhanapal
            Mar 24 at 19:43











          • I updated the comment, I think Header should not be wrapped in commas

            – Alexandr Zavalii
            Mar 24 at 19:44











          • oh... Sorry for the confusion.. I mean the header: and content: attribute itself not recognized.

            – Dhanapal
            Mar 24 at 19:47











          • @Dhanapal sorry I dont understand. Check this example: codesandbox.io/s/wkyjk2426l?module=/example.js

            – Alexandr Zavalii
            Mar 24 at 20:12

















          • ya.. That works.. but i am getting an error at header tag. it's not recognized like size or dimmer. How to make the header and content to Modal attributes?

            – Dhanapal
            Mar 24 at 19:43











          • I updated the comment, I think Header should not be wrapped in commas

            – Alexandr Zavalii
            Mar 24 at 19:44











          • oh... Sorry for the confusion.. I mean the header: and content: attribute itself not recognized.

            – Dhanapal
            Mar 24 at 19:47











          • @Dhanapal sorry I dont understand. Check this example: codesandbox.io/s/wkyjk2426l?module=/example.js

            – Alexandr Zavalii
            Mar 24 at 20:12
















          ya.. That works.. but i am getting an error at header tag. it's not recognized like size or dimmer. How to make the header and content to Modal attributes?

          – Dhanapal
          Mar 24 at 19:43





          ya.. That works.. but i am getting an error at header tag. it's not recognized like size or dimmer. How to make the header and content to Modal attributes?

          – Dhanapal
          Mar 24 at 19:43













          I updated the comment, I think Header should not be wrapped in commas

          – Alexandr Zavalii
          Mar 24 at 19:44





          I updated the comment, I think Header should not be wrapped in commas

          – Alexandr Zavalii
          Mar 24 at 19:44













          oh... Sorry for the confusion.. I mean the header: and content: attribute itself not recognized.

          – Dhanapal
          Mar 24 at 19:47





          oh... Sorry for the confusion.. I mean the header: and content: attribute itself not recognized.

          – Dhanapal
          Mar 24 at 19:47













          @Dhanapal sorry I dont understand. Check this example: codesandbox.io/s/wkyjk2426l?module=/example.js

          – Alexandr Zavalii
          Mar 24 at 20:12





          @Dhanapal sorry I dont understand. Check this example: codesandbox.io/s/wkyjk2426l?module=/example.js

          – Alexandr Zavalii
          Mar 24 at 20:12



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55327547%2fconditional-rendering-inside-the-component%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현