1

I tried to use the StepZilla Component from: https://github.com/newbreedofgeek/react-stepzilla but I have a problem.

I tried the following like explained in the StepZilla homepage:

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';

var StepZilla = require('react-stepzilla');
const steps =
    [
      {name: 'Step 1', component: <App />}
    ];

ReactDOM.render(<div className='step-progress'>
    <StepZilla step={steps}/>
</div>,document.getElementById('stepDemo'));

I always get the following error for the line <StepZilla step={steps}/>: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

But I think this is correct, because in the example from the StepZilla page it's the same step variable.

Rachid K.
  • 4,490
  • 3
  • 11
  • 30
codenewbie
  • 61
  • 7

1 Answers1

1

I had the same problem, I solved it with a workaround, requiring it like this:

var StepZilla = require('react-stepzilla').default;

See the answers of a similar question:

Guillermo
  • 21
  • 1
  • 4