react-native-windows-samples
react-native-windows-samples copied to clipboard
Documentation for custom props
Hey there!
I found it really hard to figure out react-native-windows specific custom props like onMouseEnter
for the view component. There seems to be no (complete) documentation of the neat props you added to the components. For View props there is IViewWindowsProps docs but there are many probs missing.
Maybe you already have this, but the best discoverability of props I find is through typescript types. Do you provide your own types for components? Obviously the vanilla react-native ViewProps
type would not have onMouseEnter
for example.
Is there a list of all custom props? Do you need any help in adding them to the docs?
This is probably aligned with microsoft/react-native-windows#3587 and similar. We would love some help on this though :) The docs are in the react-native-windows-samples repo
Looks like there's type information missing for APIs there, like the one you mentioned. It's unclear if the docs have a stale snapshot, of if we're missing the export.
In addition, the documentation is pretty light on these, for those that do exist.
And then, some of these need to move out to community modules (although some will stay).
@stmoy I know you coordinated a scrub of API docs recently. Was that just the native APIs? This one still isn't showing up.
@chrisglein - the API docs were a manual conversion of the IDL files located here into doc form.
Is there an easy way to identify/scrub the windows-specific APIs? CC: @acoates-ms
the problem is complex for a few reasons: -we changed the typings but didn't document them -there are some props that will be quickly deprecated by similar props coming from core, maybe we shouldn't document those -we may be changing the behavior of some already existing props
First step is to catalog them. Not all will survive (for example upcoming changes to mouse/keyboard APIs), but we need to know what's there and decide how to document their temporary presence.
We're working on documenting the keyboard/mouse APIs better, but they're still being developed (esp. the mouse stuff is subject to change).
@erksch https://github.com/DefinitelyTyped/DefinitelyTyped/pull/51062 brought in some new Windows-specific typings for 0.64 in TypeScript, such as onFocus / onBlur
on Pressable
.
When you see gaps in doc coverage, the best way to see what's available would be to look at examples in RNTester, where we try to demo all new props.
Related issue: #541