react-native-windows-samples icon indicating copy to clipboard operation
react-native-windows-samples copied to clipboard

Documentation for custom props

Open erksch opened this issue 4 years ago • 8 comments

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?

erksch avatar May 23 '20 09:05 erksch

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

asklar avatar May 23 '20 22:05 asklar

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).

chrisglein avatar May 28 '20 18:05 chrisglein

@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 avatar Jul 14 '20 00:07 chrisglein

@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

stmoy avatar Aug 17 '20 23:08 stmoy

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

kmelmon avatar Aug 27 '20 18:08 kmelmon

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.

chrisglein avatar Aug 31 '20 18:08 chrisglein

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.

rectified95 avatar Apr 29 '21 00:04 rectified95

Related issue: #541

crutchcorn avatar Mar 14 '22 22:03 crutchcorn