Skip to content

Conversation

@es-romo
Copy link
Contributor

@es-romo es-romo commented Jun 13, 2024

  • Allow initialData to be a function.
  • Update api/props/ and api/props/initialdata docs

The function is being called twice in development builds because of strict mode but it does not impact production builds.

close: #8107

@vercel
Copy link

vercel bot commented Jun 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
excalidraw ✅ Ready (Inspect) Visit Preview Jun 23, 2024 4:37am
excalidraw-package-example ✅ Ready (Inspect) Visit Preview Jun 23, 2024 4:37am
excalidraw-package-example-with-nextjs ✅ Ready (Inspect) Visit Preview Jun 23, 2024 4:37am
1 Ignored Deployment
Name Status Preview Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Jun 23, 2024 4:37am

@es-romo
Copy link
Contributor Author

es-romo commented Jun 14, 2024

It's good for review! @dwelle

I'm not 100% convinced about the wording for the initialData doc so please let me know what you think.

@dwelle
Copy link
Member

dwelle commented Jun 21, 2024

Looks good, thanks for the PR!

@dwelle
Copy link
Member

dwelle commented Jun 21, 2024

@es-romo I forgot to mention that the docs changes must be made in a separate PR merging them into docs-next branch, because we will be updating the public docs only after we release the next stable npm release (we currently don't version the docs).

When you're at it, could you also update the description of this page so it reflects the function signature https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props/initialdata?

@dwelle
Copy link
Member

dwelle commented Jun 21, 2024

Also, please update the changelog packages/excalidraw/CHANGELOG.md (unreleased -> features) 🤗

@es-romo es-romo force-pushed the es-romo/initialdata-function branch from b11be5c to e24b7ca Compare June 23, 2024 04:31
@dwelle
Copy link
Member

dwelle commented Jun 24, 2024

Good to go, thanks!

@dwelle dwelle merged commit 6ba9bd6 into excalidraw:master Jun 24, 2024
@es-romo
Copy link
Contributor Author

es-romo commented Jun 24, 2024

@dwelle thanks for merging it! I'm finishing up the docs now (sorry for the delay). I have one question though, it is in the other pr #8166.

@es-romo es-romo deleted the es-romo/initialdata-function branch June 24, 2024 19:34
Jauhen pushed a commit to Jauhen/excalidraw that referenced this pull request Nov 7, 2024
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.

allow props.initialData to be function

2 participants