[feat] add focus style props for non DOM renderers #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR:
focusedStyle
,focusedLeafStyle
,disabledStyle
andactiveStyle
props. These props merge a given style object to the existingstyle
object prop for the inner component.file:../etc
. Runningnpm run build
and then importing your forked lib viafile:../path/to/lrud
wasn't recognising the optional chaining here, https://github.com/jamesplease/lrud/blob/master/src/utils/create-node.ts#L77 This is important as with this fix I can resume creating replicas of the/examples
folder, usingrevas
insteadrevas
renderer, which uses similar styling idioms to React NativeExample
Notes
My motivation for writing this was to use the
lrud
lib with a non ReactDom renderer, in this caserevas
.Issues
<FocusNode/>
component, as to do so would requirereact
andreact-dom
. Adding those, even if only for a test, seems to include them in the bundle deps and this then causes conflicts with react projects wanting to uselrud
. I think the issue is related to the output of the build including*.test.ts{x}
files as well, but am not sure, and also could not work out how to make babel not include such files when building.warning()
util, which gets a green tick on the pipeline, but is perhaps against the intent of the coverage. Certainly feels like it's gaming it a bit.basic
,grid
,trap
working much like thereact-dom
equivalents. I will push them to my github repo soon.