3 ms·
I think the difference is that nothing in React is abusing fault tolerance in a browser to the extent that this is. This very specifically works only because br
by ryanbrunner 6y ago
I think the difference is that nothing in React is abusing fault tolerance in a browser to the extent that this is. This very specifically works only because browsers don't generally care that an HTML page is anything close to valid HTML. There's no guarantee at all that this will continue to be the case, and it's resonable to assume that some browser in the future might decide to do render things that are very clearly a JSON document as a JSON document instead - fundamentally breaking the core architecture of your system.
React is a different approach, but it plays by the rules and doesn't serve invalid HTML or Javascript.
- silvester23 6y agoIn fact, at least Firefox already has support for displaying JSON files. I assume this does not happen here because eventually, there actually is an <html> tag.
- jacob019 6y agoContent-Type header.