-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
fix: remove t from getDefaultAppState and allow name to be nullable #7666
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
|
Since we're keeping This goes hand in hand with my previous suggestion to stop preventing editing the filename when We could then even remove If we agree, there let's also do:
|
|
Made a change here to keep Makes it slightly less safe for us too, alas. |
…xcalidraw#7666) * fix: remove t and allow name to be nullable * pass name as required prop * remove Unnamed * pass name to excalidrawPlus as well for better type safe * render once we have excalidrawAPI to avoid defaulting * rename `getAppName` -> `getName` (temporary) * stop preventing editing filenames when `props.name` supplied * keep `name` as optional param for export functions * keep `appState.name` on `props.name` state separate * fix lint * assertive first * fix lint * Add TODO --------- Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
for #7500
The above import results in 👇
Since
getDefaultAppStateis usingtfor computing default value ofname, it ends up importing alllocales,reactandjotaias well.This is a default state and should be independent of
t. So we can stop usingtingetDefaultAppState. Allowingtto benullableand created a functiongetAppNameinApp.tsxwhich is used through out the app to get the ap name and exposed via theexcalidrawAPIas well so host can use it as well.This way the code stays simple and less error prone compared to just allowing the
tto beempty stringand the dependency oftis also removed fromgetDefaultState