## Description
This PR ensures that the default prettier config is used for examples
and templates.
This config is compatible with `prettier@3` as well (upgrading prettier
is bigger change that can be a future PR).
## Changes
- Updated `.prettierrc.json` in root with `"trailingComma": "es5"` (will
be needed upgrading to prettier@3)
- Added `examples/.prettierrc.json` with default config (this will
change every example)
- Added `packages/create-next-app/templates/.prettierrc.json` with
default config (this will change every template)
## Related
- Fixes#54402
- Closes#54409
### What?
Update **with-redux** example.
### Why?
**with-redux** example have:
- outdated packages
- outdated approaches and relies on **pages** directory
Since **app router** is stable now and is recommended to use, I've updated this example.
### How?
An update includes:
- move example to **app router**
- update **package.json** deps to the latest versions
- modernize jest by switching from **ts-node** to **@swc/jest**
- fix and overhaul **tests**
- modernize **redux** infra
- overhaul example **source code quality**
Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
After talking with markerikson, I've made some updates to the Redux examples:
- Updated the `with-redux` example to use the Redux Toolkit + TypeScript example
- Updated dependencies of `with-redux` to work with latest testing setup
- Removed `with-redux-toolkit` in favor of `with-redux`
- Removed `with-redux-toolkit-typescript` in favor of `with-redux`
- Removed `with-redux-code-splitting` in favor of `with-redux`
@lfades hope this works. I have updated the example to show differences between client/ssr/ssg initial state in redux. Let me know if something needs to be changed.
## Changes
- [x] Remove _app.js usage
- [x] Migrate withRedux HOC to functional component
- [x] Add correct display name
- [x] Remove abstractions/boilerplate from example
- [x] Add useInterval HOC from Dan
It's better that Counter behave not only `increment (add)` but also `decrement` or `reset`.
* Add decrement, reset handlers and rename add handler in `components/counter.js`
* Add increment, decrement, reset actions to `store.js`
* Rename page component class name: Counter => Index in `pages/index.js`
* Remove needless dispatch count event on getInitialProps in `pages/index.js`
* Format JSX to be readable in `pages/_app.js`
* Remove needless line from `components/examples.js`
* Remove needless spaces in `lib/with-redux-store.js`