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

Refresh (and clean) listeners when db changes #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

icastillejogomez
Copy link

@icastillejogomez icastillejogomez commented Jan 3, 2025

Trying to find a solution to this issue Studio presents an empty page on all browsers #7 I've realized that the library is not prepared to allow passing diferents databases or passing null or undefined as a first value (common if the db instance comes from another hook that get the instance asynchronously).

As I've commented in here this library fails as the some people complains in the issue above with a blank screen when you retrieve the instance like this:

...
import { useDrizzleStudio } from 'expo-drizzle-studio-plugin';
...

export default function App() {
  const db = useDb();
  useDrizzleStudio(db);
  
  return (
    ...
  )
}

Personally, I patched this library because I'm only able to get the instance of db asynchronously and there is not any way to fix it apart from this PR.

Please, if you need to update something in this PR to be compliant let me know to accomplish it ASAP.

@icastillejogomez icastillejogomez marked this pull request as ready for review January 3, 2025 18:40
@icastillejogomez icastillejogomez changed the title Refresh (and clean) listeners when db changes Refresh (and clean) listeners when db changes to fix blank screen Jan 3, 2025
@icastillejogomez icastillejogomez changed the title Refresh (and clean) listeners when db changes to fix blank screen Refresh (and clean) listeners when db changes Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant