-
Notifications
You must be signed in to change notification settings - Fork 40
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
Error on a React Fragment #2
Comments
I cannot produce the error here with the newest version. Can you provide a more detailed example with code and what version are you using? |
I'm using gxl/react-scripts 2.2.6. Here is my code, which is the basic create-react-app App file : class App extends Component {
render() {
return (
<Fragment className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<Link
className={styles['App-link']}
to="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</Link>
</header>
</Fragment>
);
}
} Here is the console error :
|
In react-scoped-css it won't add data-v attribute to And also there is one problem with your code, react fragment doesn't accept any props other than So you should change your code to this: class App extends Component {
render() {
return (
<>
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<Link
className={styles['App-link']}
to="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</Link>
</header>
</>
);
}
} |
Hi ! I have an error with the scoped styles when my component is nested in a
Fragment
:Invalid prop data-v-4e235659 supplied to React.Fragment
How can I avoid it ?
Thanks !
The text was updated successfully, but these errors were encountered: