Storytel / react-redux-spinner

An automatic spinner for react and redux
https://storytel.github.io/react-redux-spinner/
MIT License
81 stars 13 forks source link

Change UI of spinner #34

Closed lalinda74 closed 4 years ago

lalinda74 commented 4 years ago

Is it possible to change the svg of spinner ?

noseglid commented 4 years ago

The spinner itself is delegate to nprogress. You can configure it by setting its template. This can be set through react-redux-spinner's config property.

Something like this

<Spinner config={{ template: '<div ...> ' }} />
lalinda74 commented 4 years ago

The spinner itself is delegate to nprogress. You can configure it by setting its template. This can be set through react-redux-spinner's config property.

Something like this

<Spinner config={{ template: '<div ...> ' }} />

@noseglid I have used the config as below. <Spinner config={{ template: '<div className="sp sp-wave"></div>' }}></Spinner>

and I'm getting below error.

Uncaught TypeError: Cannot read property 'style' of null

noseglid commented 4 years ago

Do you have a stack trace? The config object is passed verbatim to nprogress. I'm not seeing a style reference anywhere.