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

ObjectType.shape is not a function #44

Open
jbeckton opened this issue May 3, 2022 · 1 comment
Open

ObjectType.shape is not a function #44

jbeckton opened this issue May 3, 2022 · 1 comment

Comments

@jbeckton
Copy link

jbeckton commented May 3, 2022

What version of schema-typed are you using?

2.0.2

Describe the Bug

schema_typed_1.ObjectType.shape is not a function

Expected Behavior

no type error

To Reproduce

I copied your first code example into an online editor to run it and the lib has a type error.

https://github.com/rsuite/schema-typed#getting-started

https://stackblitz.com/edit/typescript-z822z2

@simonguo
Copy link
Member

simonguo commented May 3, 2022

hi @jbeckton
There are errors in the example code in the documentation. Should be ObjectType().shape

-role: ObjectType.shape({
+role: ObjectType().shape({
  name: StringType().isRequired('Name required'),
  permissions: ArrayType().isRequired('Permissions required'),
})

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

2 participants