I find that SX looks just like HTML with some slight differences. I don't see it really differs from the template section of single file vue components?
So with Vue you don't have your logic in the same page as your templating? Why would that be advantageous? With React depending on what you do, it can be optional. Some things have to be in the component, some things don't i.e. reducers
Styling being seperated is really up to you with React.
You can use CSS, or any other styling directives that you prefer, so you can have single file components with styled components
Also I don't think importing syntax is a bad thing. It makes it clear to others in your project to know quickly and clearly which is native HTML and which is from a library. Most IDEs autocomplete import so it doesn't add any extra pain.
Sorry for all these points/questions. I would love for us to build a component that doesn't something small and simple and compare the pros and cons of both.
Here is a simple version of mine in React with Hooks. Could you build yours with modern Vue and show me how that work?
importReact,{useState}from"react"/* component that increments the value of a number displayed in a p tag using onClick event listener attached to button */constCountComponent=({initialCount})=>{const[count,setCount]=useState(initialCount)consthandleClick=()=>setCount(currentCount=>currentCount+1)return(<div><p>Mycountis{count}</p>
<buttononClick={handleClick}>IncrementCount</button>
</div>
);};// Using count component in another componentconstMainComponent=()=>{return(<main><CountComponentinitialCount={0}/>
<CountComponentinitialCount={1}/>
<CountComponentinitialCount={2}/>)
</main>
);};// or using javascript map function to declaratively add list of componentsconstMainComponent=()=>{return(<main>{[0,1,2].map((initialCount,index)=>(<CountComponentkey={index}initialCount={initialCount}/>
))}</main>
);};
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I find that SX looks just like HTML with some slight differences. I don't see it really differs from the template section of single file vue components?
So with Vue you don't have your logic in the same page as your templating? Why would that be advantageous? With React depending on what you do, it can be optional. Some things have to be in the component, some things don't i.e. reducers
Styling being seperated is really up to you with React.
You can use CSS, or any other styling directives that you prefer, so you can have single file components with styled components
Also I don't think importing syntax is a bad thing. It makes it clear to others in your project to know quickly and clearly which is native HTML and which is from a library. Most IDEs autocomplete import so it doesn't add any extra pain.
Sorry for all these points/questions. I would love for us to build a component that doesn't something small and simple and compare the pros and cons of both.
Here is a simple version of mine in React with Hooks. Could you build yours with modern Vue and show me how that work?