Skip to content

Conversation

@rawrmonstar
Copy link
Contributor

@rawrmonstar rawrmonstar commented Dec 22, 2018

Description

This adds a state prop to <Slide /> that accepts a string. By default the behavior is to look at the currently rendered <Slide /> and add the state prop to the document root (html tag) as a class. This behavior can be modified by passing a onStateChange function prop to the <Deck />. The function excepts 2 arguments: (previousState, nextState) => { /* do whatever you want */ } and is called when a slide with a different state prop than the previous one is mounted--this includes from when a slide has a state and the next slide does not have a state.

Fixes #434

Type of Change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update (included in this PR)

How Has This Been Tested?

Tested manually using spectacle-boilerplate and I've added some tests to our suite.

Checklist: (Feel free to delete this section upon completion)

@rawrmonstar rawrmonstar merged commit 58c12bd into master Dec 26, 2018
@rawrmonstar rawrmonstar deleted the rawrmonstar/add-slide-state branch December 26, 2018 23:17
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.

3 participants