score:3
please add a reference to your deck
component like below
<deck ref={(deck) => {this.deck = deck; }} transition={["zoom", "slide"]} transitionduration={500} theme={theme}>
...
</deck>
now you have a property by the name of deck
in your component. use componentdidmount
lifecycle method to retrieve this.deck.props.children.length
and assign it to window.slidecount
.
componentdidmount() {
window.slidecount = this.deck.props.children.length
}
now open browser console and type slidecount
, you will se you have slide count displayed there. after that you can use following to change the slides
window.location = "#/1"
score:0
from the docs,
the gotoaction tag lets you jump to another slide in your deck. the gotoaction can be used a simple button that supports base styling or accept a render prop with a callback to support custom components
the following code will render a button that will jump to a specific slide in your deck.
<gotoaction slide={3}>jump to 3</gotoaction>
Source: stackoverflow.com
Related Query
- how to control spectacle presentation with pure javascript?
- How to configure atom-beautify package to format with babel/jsx javascript files?
- How to add external javascript file with reactjs
- How do I rewrite a react component with decorators as a pure function?
- How to redirect page with Javascript in React-Router?
- Javascript / webpack : how to concatenate all json files in directory with a custom loop over files
- How to reload input value in React / Javascript with Virtual DOM?
- how to control the re-running with useEffect
- How to control meteor data stream with react?
- How to set up NetlifyCMS with a pure react app
- How to declare a nested Javascript object in one statement with variable keys
- How leetcode do this: Read user's input String as multiple JavaScript functions and run a main function with user's input params
- React: How can I control a list of <input> with state?
- Control order of TAB with javascript (react)
- How do you remove a nested property with spread and rest in javascript
- How to download single file with multiple chunks in javascript using fetch API
- How to render a code snippet with javascript format by material-ui
- How to control react-bootstrap carousel with custom buttons?
- How to send authorization, cookie headers with javascript fetch API
- How to convert javascript obj into URL parameters with nested object in it?
- How to iterate over json with root node in JavaScript
- How to make a function as pure function using javascript and react?
- how to properly make div tab in javascript to work with reactjs
- How do I convert number with ordinal suffix to Number in javascript
- How to remove HTML tag (not a specific tag ) with content from a string in javascript
- how do control the state for multiple component with one function
- How Sub classing with extends for React or Javascript work?
- With JavaScript + React, how to have a string evaluate inline?
- how to replace all the periods after the first of a string with the javascript replace function?
- How to allow javascript compilation with typescript errors,
More Query from same tag
- How to set array of object empty in state object using useState in React JS?
- Component with shouldComponentUpdate vs stateless Component. Performance?
- How to use Chart.js with Ionic React?
- Change color of single anchor link on hover in React js
- Antd 3.26 form validation messages are not rerendering with new value when state/props are changing
- Typescript: Types of property 'data' are incompatible
- React (SPFx - Sharepoint Framework): Control order of imported css classes
- react-data-grid x-axis scroll issue
- React, MongoDB, Mongoose: How to format my date to be readable?
- Having problems with child div background color HTML Yahoo email
- React: react-bootstrap button
- Getting errors while importing a forked repo as react.js dependencies
- Adding a radio button value to parent component in react
- Escaping "import" and react/html to display as text in MDX?
- I am getting Unhandled Rejection (TypeError): router.transitionTo is not a function. What could possibly be wrong?
- How to fix "Element type is invalid: expected a string ... but got: object" error in React
- No Access-Control-Allow-Origin header is present on the requested resource. set the request's mode to no-cors to fetch the resource with CORS disabled
- Passing Props in React And Substring It In Another Component
- Why useEffect does not behave like what i expect?
- Gatsby createPage actions vs {page.slug}.js
- How to properly unit test ReactDOM.render with Karma and PhantomJS?
- How to fit all elements into React-Bootstrap cards with flexbox?
- Making ajax call in Reactjs, value coming empty while rendering
- The target origin provided does not match the recipient window's origin (Rocket chat)
- How to mock async method in an interface with Jest?
- Disable video player for background video ReactJS
- How to insert data in child table from react to django rest framework models
- passing props to a static React Components
- axios post api data sent gives empty object on console.log(req.body) on server side
- Passing a string to clickHandler in a react functional component