3 ms·
Just want to say I fully agree with you. react-router seems like a useful library, but I see utterly no reason why you should write your routes in JSX instead o
by meowface 12y ago
Just want to say I fully agree with you. react-router seems like a useful library, but I see utterly no reason why you should write your routes in JSX instead of as a simple JS object. Using JSX for anything other than DOM insertion or modification creates an impedance mismatch. The public API makes no real sense to me.
The point of JSX is to more easily build dynamic HTML (and perhaps other markup).
- ryanflorence 12y agoThen use them as JavaScript functions, because that's what they are :) The point of JSX is to express attributes and hierarchy, which matches with our route configs perfectly.
- ryanflorence 12y agoIf you read the overview you may understand our opinion that "application state" is precisely which views to render. https://github.com/rackt/react-router/blob/master/docs/guides/overview.md https://github.com/rackt/react-router/blob/master/docs/guide... We're almost done with serializing the application data as well. Both pieces are important.