@machinemetrics/mm-react-tools 2.1.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,7 +14,7 @@ Components, hooks, and helper functions for writing React apps using MachineMetr
14
14
  ## Install
15
15
 
16
16
  ```bash
17
- yarn add mm-react-tools
17
+ npm install @machinemetrics/mm-react-tools
18
18
  ```
19
19
 
20
20
  ## Peer Dependencies
@@ -22,7 +22,7 @@ yarn add mm-react-tools
22
22
  Due to how Apollo, React, and other libraries work, there are some additional dependencies that you'll need to include in your project:
23
23
 
24
24
  ```bash
25
- yarn add react react-router-dom styled-components @apollo/client subscriptions-transport-ws graphql
25
+ npm install react react-router-dom styled-components @apollo/client
26
26
  ```
27
27
 
28
28
  ## Getting Started
@@ -32,12 +32,11 @@ Wrap your application in the `MMProvider` to wire up everything necessary to aut
32
32
  ```jsx
33
33
  import React from 'react';
34
34
  import ReactDOM from 'react-dom';
35
- import { MMProvider } from 'mm-react-tools';
35
+ import { MMProvider } from '@machinemetrics/mm-react-tools';
36
36
  import App from './App';
37
37
 
38
38
  ReactDOM.render(
39
39
  <MMProvider
40
- domain={process.env.REACT_APP_URL}
41
40
  clientId={process.env.REACT_APP_CLIENT_ID}
42
41
  clientSecret={process.env.REACT_APP_CLIENT_SECRET}
43
42
  releaseStage={process.env.REACT_APP_RELEASE_STAGE}
@@ -56,17 +55,19 @@ Use the `ProtectedRoute` to kick off the login flow.
56
55
  ```jsx
57
56
  // App.js
58
57
  import React from 'react';
59
- import { Route } from 'react-router-dom';
60
- import { PrivateLayout } from 'mm-react-tools';
58
+ import { Route, Routes } from 'react-router-dom';
59
+ import { PrivateLayout } from '@machinemetrics/mm-react-tools';
61
60
  import PublicPage from './PublicPage';
62
61
  import PrivatePage from './PrivatePage';
63
62
 
64
63
  function App() {
65
64
  return (
66
- <Route exact path='/public' element={<PublicPage />} />
67
- <Route element={<PrivateLayout />}>
68
- <Route path="/private" element={<PrivatePage />}>
69
- </Route>
65
+ <Routes>
66
+ <Route exact path='/public' element={<PublicPage />} />
67
+ <Route element={<PrivateLayout />}>
68
+ <Route path="/private" element={<PrivatePage />}>
69
+ </Route>
70
+ <Routes>
70
71
  );
71
72
  }
72
73