Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ilyamordasov opened this issue Jun 2, 2021 · 1 comment
Open

Comments

@ilyamordasov
Copy link

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

@marcancabrera
Copy link

I have the same problem, I tried with:

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

But I didn't get nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants