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

Demo: missing prop when rendering <Tei/> component #1

Open
arjanski opened this issue Apr 24, 2023 · 2 comments
Open

Demo: missing prop when rendering <Tei/> component #1

arjanski opened this issue Apr 24, 2023 · 2 comments

Comments

@arjanski
Copy link

Issue Summary

In the astro-tei demo code, the rendered <Tei/> component expects a useBehaviors prop that is currently not set, which results in a Typescript error.

Expected Behavior

No typescript error is shown in the demo code in index.astro.

Current Behavior

useBehaviours is neither set nor optional:

<div class="tei">
	<Tei data={teiFile} />
</div>

which results in the following TS error:

"Type '{ data: string; }' is not assignable to type 'IntrinsicAttributes & Props'. Property 'useBehaviors' is missing in type '{ data: string; }' but required in type 'Props'.ts(2322)"

Steps to Reproduce

  1. Clone this repository, pnpm install and launch dev server
  2. Check index.astro for type errors

Possible Solution

The Tei-Component expects the useBehaviors prop as defined in its types. As there's a default value set in the component itself (true), it could be made an optional prop. Alternatively, the demo code in index.astro could be amended to

<div class="tei">
	<Tei data={teiFile} useBehaviours={true} />
</div>

Context

Your Environment

@arjanski
Copy link
Author

Just a minor issue, but happy to provide a pull request for this.

@arjanski
Copy link
Author

Took the liberty of creating a PR - feel free to use it or ditch it.

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

No branches or pull requests

1 participant