use-react-router | React Hook for pub-sub behavior using React Router | Frontend Utils library
kandi X-RAY | use-react-router Summary
kandi X-RAY | use-react-router Summary
React Hook for pub-sub behavior using React Router.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of use-react-router
use-react-router Key Features
use-react-router Examples and Code Snippets
Community Discussions
Trending Discussions on use-react-router
QUESTION
I am trying to develop addins for Excel with TypeScript and React but the road to success is more than cumbersome because the Office addin does behave diffferently than a CRA React boilerplate web application. I have created a Yo Office typescript React project for my taskpane addin and in my App.tsx I have the following JSX return value:
...ANSWER
Answered 2020-Oct-25 at 20:24I found the issue to cause this error! I searched like an idiot for many weeks but somewhere in the Scaffolding of the Yeoman generator, Microsoft did a bad job in not accepting the:
QUESTION
I am using the Office.context.ui.displayDialogAsync
method in Office.js to create a popup that allows the user to login.
I used the yeoman generator to create a React template for the Add-in. I could not find an Auth0 example using Office.js and React, so I used this example which does not use react: https://github.com/OfficeDev/Office-Add-in-Auth0
To display the dialog box I pass the displayDialogAsync
method a url that looks like: https://localhost:3000/src/taskpane/popup.html.
The react way I thought of would be creating a react compoennt for the popup and then using react router (Hash router not Browser Router How to configure Office-js excel react add-in to use react-router-dom or alternative solutions?) to make the component accessible at {taskpane endpoint}/popup
like on a website.
The addin locally runs at https://localhost:3000/taskpane.html so I tried to pass the url https://localhost:3000/taskpane.html/#popup but the popup is not routed to my component like it would on a normal react website. Instead I get a 404 error.
My question is do I need to add some additional configuration for this to work, or is it just not possible in Office.js.
...ANSWER
Answered 2020-Sep-15 at 19:46Microsoft recommends that you not pass a route to the displayDialogAsync
method. See this best practice: Best practices for using the Office Dialog API in an SPA.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install use-react-router
yarn add use-react-router
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page