-
I'm looking for a way to do conditional rendering similar to Angular. If it's possible can someone give me an example? Thanks
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I think hydro is based on React, this is the code of conditional rendering in react import React, { useState } from 'react'; const TextEditor = () => { const editText = () => { const saveText = () => { return ( {/* If isEditing is false, show the text and the edit button, else show the input field and save button */} {!isEditing ? ( <> {text} Edit </> ) : ( <> <input type="text" value={text} onChange={(e) => setText(e.target.value)} /> Save </> )} ); }; export default TextEditor; |
Beta Was this translation helpful? Give feedback.
-
Hi all, please have a read at this: |
Beta Was this translation helpful? Give feedback.
-
@hmanbr Hydro uses Razor syntax, so you can use |
Beta Was this translation helpful? Give feedback.
@hmanbr Hydro uses Razor syntax, so you can use
if
statement. Here you can read more about that.