Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a tip to avoid beginer mistake #3884

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions website/docs/from_provider/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ Take your time, as it is important to get yourself familiar with Riverpod first;
you'll quickly find out that *almost* all Providers from pkg:provider have a strict equivalent in pkg:riverpod.
:::

:::tip
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be better to update the snippets to include imports, with prefixes.
It both suggests using prefixes and makes it cleared which package we're referring to when reading the code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provider would probably not have a prefix during a transition. Only Riverpod will have them. is riverpod_lib a good prefix for the doc?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add a prefix on the provider import.

import 'package:provider/provider.dart' as provider;

If your code requires a `create` parameter, ensure that you are using a `ChangeNotifierProvider` from the *Provider* package, not the *Riverpod* package.
Double-check the import prefixes in your code to verify the correct package is being referenced.
:::

## Starts with *leaves*

Start with Providers that do not depend on anything else, i.e. start with the *leaves* in your dependency tree.
Expand Down
Loading