Skip to content

RenderProps for FocusableSection (maps to leaveFor) + 1 lifecycle update for removing sections #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chwagssd
Copy link

@chwagssd chwagssd commented Nov 12, 2018

  • <new RenderProp> created sectionId configuration to allow sections to utilize leaveFor option
  • <new RenderProp> added 4 neighbor options for FocusableSection to allow for declarative navigation between sections
    • documented new properties
    • neighborUp/neighborRight/neighborDown/neighborLeft
      • mapped into the js-spatial-navigation config option for a section: 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

…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
@chwagssd chwagssd mentioned this pull request Nov 14, 2018
… 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant