Xtermjs 4.0.0, not working in my react in app

Viewed 690

I am working on an react terminal app using xtermjs 3.14 before, and it's working ok. But when I want to update it to xtermjs 4.1.0 and add new addons, it's broken and reply different types errors. I follow the steps from the release notes.

import {Terminal} from 'xterm';
import {FitAddon} from 'xterm-addon-fit';

var term = new Terminal({cursorBlink: true});
var fitAddon = new FitAddon();
term.loadAddon(fitAddon)

class TerminalPage extends Component {
   componentDidMount(){
      term.open(document.getElementById('terminal'));
   }
}

terminalapp startup failed TypeError: R.on is not a function

or

x is not defined

0 Answers
Related