<Fragment> tag does not render html in chrome nor throw any error in JSX Preprocessing
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.8k
- Forks
- 7.9k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 11
Description
https://beta.reactjs.org/reference/react/Fragment#fragment
Doesnt throw error in jsx preprocessing(npx babel --watch sr --out-dir . --presets react-app/prod) for babel version:6.26 installed as per current official react install docs ,please have a check if new beta version supports.
Can be related to
#5532 ?
{/* index.html */}
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Test Page-React</title>
</head>
<body>
<div id="Sc"></div>
<script src="https://unpkg.com/react@18/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" crossorigin></script>
<!-- Load your React component. -->
<script type="module" src="test.js"></script>
</body>
</html>
{/* test.js */}
{
const root9 = ReactDOM.createRoot(document.getElementById('Sc'));
const element9 = <Gallery />;
root9.render(element9);
function ProfileS() {
return (
<img
src="https://i.imgur.com/MK3eW3As.jpg"
alt="Katherine Johnson"
/>
);
}
function Gallery() {
return (
<Fragment>
<div>
<h1>Amazing scientists</h1>
<ProfileS /> {/* react component 1 */}
<ProfileS /> {/* react component 2 */}
<ProfileS /> {/* react component 3 */}
</div>
<div>
<ProfileS /> {/* react component 1 */}
<ProfileS /> {/* react component 2 */}
</div>
<div>
<Pile />
</div>
</Fragment>
);
}
function Pile() {
return (
<img
src="https://i.imgur.com/QIrZWGIs.jpg"
alt="Alan L. Hart"
/>
);
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Fragment reference linked in the issue, then reproduce the example from test.js using the provided index.html and the npx babel --watch command with Babel 6.26. Confirm whether the documented Fragment example renders with the React 18 UMD scripts, and update the relevant documentation or report the confirmed incompatibility.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100