Skip to main content

Engine Context

Context for accessing the Engine API#

Usage#

You can access the Qlik engine in any component in your React component tree, see below for an example which returns the engine to the console.

Example accessing the Engine object#

import React, { useContext } from 'react'
import { EngineContext } from '@motor-js/core'
const Example = () => {
const { engine, engineError } = useContext(EngineContext)
console.log(engine)
return (
<div>
</div>
)
}
export default Example

Example accessing the Capability APIs#

import React, { useContext } from 'react'
import { EngineContext } from '@motor-js/core'
const Example = () => {
const { app } = useContext(EngineContext)
const clear = () => {
app.field('Date').clear()
}
// ...