question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flow `className` is missing in `ViewProps`

See original GitHub issue

Hi 😃 Excellent module. Thank you 🙏

I’m using Flow types in my RN app. And it reports…

Flow: Cannot create `View` element because property `className` is missing in `ViewProps` [1] but exists in props [2]. 

I see that this was solved for Typescript in https://github.com/marklawlor/nativewind/issues/124#issuecomment-1190630695

Any suggestions on how to solve this for Flow? I’m hoping we can extend Flow config somehow… 🤔

Screen Shot 2022-09-05 at 22 30 01

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
marklawlorcommented, Sep 6, 2022

Typescript solves this via module augmentation, which allows custom types to be merged on top of the RN types. https://github.com/marklawlor/nativewind/blob/main/packages/nativewind/types.d.ts

I’m trying to find a similar concept in Flow

1reaction
marklawlorcommented, Sep 6, 2022

I’m not a Flow user so I’ll have to do some research into how module augmentation works within it’s type system

If you know of other libraries that were written in Typescript but have good Flow types can you let me know and I’ll look at their workflow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ClassName props is missing in object type. Flow and CSS ...
I Cannot create View element because property className is missing in object type [1] but exists in props [2]. What can I do?...
Read more >
Can't pass props with excess properties · Issue #15463 - GitHub
@yuit I have compiled my code via build 2.4.0-dev.20170509, the error is gone. So I am waiting for v2.3.3 to move on.
Read more >
Deciphering TypeScript's React errors | by Fiona Hopkins |
Property 'fieldName' is missing in type '{}'. — Now TypeScript is being specific about why an object of type {} is not assignable...
Read more >
React: Type {children: Element} has no properties in common ...
The React.js error Type {children: Element} has no properties in common with type IntrinsicAttributes occurs when we try to pass a `children` prop...
Read more >
Props List API - React Flow
Array of nodes (for an uncontrolled flow) ... Called when user connects two nodes in a controlled flow ... Additional class name for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found