178 - Update application container documentation#180
Conversation
thgaskell
left a comment
There was a problem hiding this comment.
I like the content, but I think this is explaining too much outside of the React component scope. Some of this content should be moved to the JavaScript library documentation and/or the Building Your Application sections.
| - Offline: Shows a warning toast with "Application is offline". | ||
| - Online: Shows an informational toast with "Application is online". | ||
|
|
||
| 4. **Lifecycle Hooks** |
There was a problem hiding this comment.
Lifecycle hooks are part of the JavaScript library, not the React component.
| ? "/mockServiceWorker.js" | ||
| : "/service-worker.js", | ||
| }, | ||
| mocks: { |
There was a problem hiding this comment.
The mocks property isn't officially supported. Mocks are currently handled by the mock service worker.
There was a problem hiding this comment.
I see, so the mocks property can be removed?
I was looking back at the mock-api example, should it be updated as well? - https://github.com/NMFS-RADFish/boilerplate/tree/main/examples/mock-api
| }); | ||
| ``` | ||
|
|
||
| ### The Custom Storage |
There was a problem hiding this comment.
| ### The Custom Storage | |
| ### Custom Storage |
There was a problem hiding this comment.
This entire section may be better moved to the JavaScript library documentation rather than under the container code.
| import React from "react"; | ||
| import ReactDOM from "react-dom/client"; | ||
| import { Application } from "@nmfs-radfish/radfish"; | ||
| import App from "./App"; |
There was a problem hiding this comment.
Remove this for documentation usage. Just use <Application /> component.
| // 4. Finally, render your React app, passing "app" | ||
| root.render( | ||
| <React.StrictMode> | ||
| <App application={app} /> |
There was a problem hiding this comment.
This is too indirect for component documentation.
It just needs to demonstrate:
const myApp = new Application(/*...*/);
// ...
<Application application={myApp} />| > “Here’s my initialized Application instance. Use it to set up offline support, register service workers, coordinate data storage, and etc..” | ||
|
|
||
| ```jsx | ||
| // App.jsx |
There was a problem hiding this comment.
It would be clearer to explain this section without using App.js file. It's a little too indirect. The documentation shouldn't be imposing patterns that we use in the templates.
|
Thanks for the feedback and suggestions!
|
issue #178
Applicationbetweenradfishandreact-radfishpackage