From 555239d585f65f0586410391e50ddb447819cd59 Mon Sep 17 00:00:00 2001 From: kuu12 Date: Tue, 28 Aug 2018 16:05:43 +0800 Subject: [PATCH] Debug --- demo/app.jsx | 27 ++++++++++---------- demo/index.html | 47 +++++++++++++++++++++++++++++++++++ demo/navigation-bar.jsx | 1 + src/{one-of.js => one-of.jsx} | 5 ++-- 4 files changed, 64 insertions(+), 16 deletions(-) create mode 100644 demo/index.html rename src/{one-of.js => one-of.jsx} (73%) diff --git a/demo/app.jsx b/demo/app.jsx index 81659c5..7ac8797 100644 --- a/demo/app.jsx +++ b/demo/app.jsx @@ -34,20 +34,19 @@ class App extends React.Component { setToken={this.setToken} /> } -

- - - - - - - - - - - - -

+ + + + + + + + + + + + + ); diff --git a/demo/index.html b/demo/index.html new file mode 100644 index 0000000..cc69d60 --- /dev/null +++ b/demo/index.html @@ -0,0 +1,47 @@ + + + + + + + Demo of Less-Router + + + + + + + + + + + + diff --git a/demo/navigation-bar.jsx b/demo/navigation-bar.jsx index 08e371e..2633eea 100644 --- a/demo/navigation-bar.jsx +++ b/demo/navigation-bar.jsx @@ -23,6 +23,7 @@ const NavigationBar = ({ router, token, setToken }) => ( +
); diff --git a/src/one-of.js b/src/one-of.jsx similarity index 73% rename from src/one-of.js rename to src/one-of.jsx index 15f17cf..27ecb98 100644 --- a/src/one-of.js +++ b/src/one-of.jsx @@ -1,3 +1,4 @@ +import React from 'react'; import proxy from './proxy'; import matching from './path/match'; @@ -10,10 +11,10 @@ const OneOf = ({ children }) => { parentPath, path, proxy.router.pathname, ); if (found) { - return !match && cached ? child :
; + return !match && cached ? child :
; } else { if (match) found = match; - return match || cached ? child :
; + return match || cached ? child :
; } }); };