RenderProps for FocusableSection (maps to leaveFor) + 1 lifecycle update for removing sections#11
Open
chwagssd wants to merge 3 commits intodead:masterfrom
Open
RenderProps for FocusableSection (maps to leaveFor) + 1 lifecycle update for removing sections#11chwagssd wants to merge 3 commits intodead:masterfrom
leaveFor) + 1 lifecycle update for removing sections#11chwagssd wants to merge 3 commits intodead:masterfrom
Conversation
…ons to utilize `leaveFor` option
- `<new RenderProp>` added `FocusableSection` to allow for declarative navigation between sections
- documented new properties
- 4 new RenderProps:
- `neighborUp`/`neighborRight`/`neighborDown`/`neighborLeft`
- mapped into `leaveFor{up, right, down, left}`
- Allowed for empty string "", to force a wall at the edge of a section
- moved `JsSpatialNavigation.add()` inside of `componentDidMount`
- Note: `componentWillMount` is being deprecated
- Order is important, and when mounting new components, `componentWillUnmount` is called after `componentWillMount`, which means duplicates between routes can occur once routing is introduced
- removed package-lock.json because it was tied to free-bsd, which means cannot build on mac/windows, so let build env determine
… so I'd moved it originally into `componentDidMount`. This had the unfortunate side effect of causing the default class to be applied, prior to the sectionId being added into the classNames. So moving that back up in the life cycle to the constructor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
<new RenderProp>createdsectionIdconfiguration to allow sections to utilizeleaveForoption<new RenderProp>added 4 neighbor options forFocusableSectionto allow for declarative navigation between sectionsneighborUp/neighborRight/neighborDown/neighborLeftleaveFor{up, right, down, left}JsSpatialNavigation.add()inside ofcomponentDidMountcomponentWillMountis being deprecatedcomponentWillUnmountis called aftercomponentWillMount, which means duplicates between routes can occur once routing is introduced