Closed jhsware closed 11 months ago
testing if re-opening the PR triggers Travis
There are some TS lint errors in the build log, can you check please?
https://app.travis-ci.com/github/infernojs/inferno/builds/267615174
A sidenote: While implementing function _isRoute(node: any) I was surprised that I needed a fallback check for inheritance of Route when routes where passed as an array (see comment in code). This feels lika an inconsistency in Inferno where array and component implementation gives slightly different results. Just wanted to mention it, I haven't investigated any further.
Yes, Since the early days of Inferno it has been so that if in JSX one node has a single children it is set as the children prop directly, if there are multiple childrens in the give node then it becomes an array.
testing coveralls
I contacted coveralls support, for some reason it is not sending the pull request comments from the service, but shows the statistics in their web app
I will merge this as the change seems good to me. Lets check that coveralls issue another time.
(rebased on master, all tests passing)
Using Switch with inferno-router was missing tests for SSR. Adding them revealed a bug where all matching routes that are children of Switch would be returned by traverseLoaders. Whereas the UI would render correctly, this would cause unnecessary calls to API:s.
Also, tightened check that path matches are only done on Route Components and not any Component that looks like a route. The current behaviour could cause unexpected behaviour.
A sidenote: While implementing function _isRoute(node: any) I was surprised that I needed a fallback check for inheritance of Route when routes where passed as an array (see comment in code). This feels lika an inconsistency in Inferno where array and component implementation gives slightly different results. Just wanted to mention it, I haven't investigated any further.