Closed berdimyradov closed 1 year ago
Name | Link |
---|---|
Latest commit | cabf530bef34d2e69903df328b4e6c53ed8aa422 |
Latest deploy log | https://app.netlify.com/sites/pr-sliced/deploys/6420c5e085ae8400082407fa |
Deploy Preview | https://deploy-preview-560--pr-sliced.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Hi! Thanks for the contribution! This one will be particularly valuable since we didn't have React Native projects previously.
I have a few remarks about the use of FSD in your project:
pages/
directory contains an index file that exports everything from 3 pages. FSD prescribes to have index files on the slice level (and, optionally, on the segment level). Also, it's not clear from the pages
directory what the slices are. The same applies to most of the other layers, I think it's important to clearly delineate slices and segments in projects.
suggestion: use the following directory structure:
In this case, the three slices are add-task
, list-tasks
, view-task-details
. Each slice has an index file and a ui
segment in form of a single file. Note that this creates an unfortunate stack of ui.tsx
files in your code editor's tabs, so to overcome that, you can name the UI files ui/add-task-screen.tsx
instead. More verbose, but clearer.
hooks
segment in entities/task
. The name of this segment is a bit problematic because it's not obvious from the name what the hooks inside are for. For example, a hook like useModalVisibleState
is for UI (therefore, should be in the ui
segment), while a hook like useCompleteTask
that exports a mutation is for lib
, since it represents the logic of the feature. In your case, the hooks useTaskDispatch
and useTaskSelector
should probably belong to lib
. However, since in Redux, these hooks apply to the whole store, not just a particular reducer, they should probably be kept in shared
task-footer
. That is a presentational component for the task
entity, it should be placed in entities/task/ui
. The same goes for task-summary
, that doesn't seem like a feature to me, the button for adding a new task should be placed in features/task-add/ui
, and the rest can probably go to pages
or widgets
with a slot for the said button to add a task.Feel free to reach out if you need any help or guidance about those
@illright Hi. Thanks for your review. Great feedback 👍
Please take a look to the updates according your issues:
@illright
I created a ReactNative (Expo) example of Todo-App based on FSD
Please consider this PR in order to add one more example to documentation