re-carousel icon indicating copy to clipboard operation
re-carousel copied to clipboard

It always shows warning with string ref and doesn't show carousel

Open ilyamordasov opened this issue 3 years ago • 1 comments

When I try to use it within React App

<Row>
                <Col>
                    <Carousel loop widgets={[IndicatorDots]}>
                        {
                            (this.state.places !== undefined)
                            ?
                                this.state.places.map( (x, index) => {
                                    return <div key={index} ><Zone name={index} callModal={this.justBook} data={x}/></div>
                                })
                            : null
                        }
                    </Carousel>
                </Col>
            </Row>

I get the warning

Warning: A string ref, "wrapper", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref
div
t@http://localhost:3000/static/js/vendors~main.chunk.js:12438:7
div
./node_modules/react-bootstrap/esm/Col.js/Col<@http://localhost:3000/static/js/vendors~main.chunk.js:14528:18
div
./node_modules/react-bootstrap/esm/Row.js/Row<@http://localhost:3000/static/js/vendors~main.chunk.js:18605:18
div
./node_modules/react-bootstrap/esm/Container.js/Container<@http://localhost:3000/static/js/vendors~main.chunk.js:14725:18
Splash@http://localhost:3000/static/js/main.chunk.js:830:5
SignIn@http://localhost:3000/static/js/main.chunk.js:626:5
App

If I add ref={this.wrapper}, where this.wrapper = React.createRef() it doesn't help. If I comment out all carousel component, there are no errors

ilyamordasov avatar Jun 02 '21 08:06 ilyamordasov

I have the same problem, I tried with:

npm i --save-dev @types/re-carousel

But I didn't get nothing.

marcancabrera avatar Jun 11 '21 20:06 marcancabrera