Questions tagged [react-fragment]
25 questions
1
vote
0 answers
React Components inside fragment not loading
I'm using react 16.2.0 and react-dom 16.2.0. Following is the code I have.
import React, { Fragment } from 'react';
import BodyComponent from './BodyComponent';
import * as HeaderComponents from './HeaderComponent';
class TablePage extends…

Sarani Mendis
- 54
- 8
0
votes
2 answers
Is a React.Fragment the same as a DocumentFragment?
React.Fragment looks like DocumentFragment. But does React.Fragment has the same performance benefits like DocumentFragment?
In other words, are this
// index.jsx
const arr = [...Array.from({length: 10000})];
return (
-
<>
…

EzioMercer
- 1,502
- 2
- 7
- 23
0
votes
2 answers
Code duplication: how to avoid in Reactjs
Expectation: if the flag is true, then empty div "container" around div "content"
const Demo = () => {
const [flagABC] = useFlagFeature(true)
return (
style= {} onMouseEnter = {} //if feature flag is off…

hightides1973
- 497
- 1
- 9
- 27
0
votes
1 answer
React Error: Target container is not a DOM Element: got when loading a Modal Form
I'm working on a shopping cart application using ReactJS and Context-API, so far, I achieved this:
load my products from Firebase
Add product to the cart
The next step is to display the cart's content loading a modal form when the user clicks on…

htamayo
- 335
- 3
- 16
0
votes
0 answers
Why my browser give me a syntax error about a div?
Browser give me this error What I'm doing wrong? This appeared only when I added the code for the loader
function App(){
const [loading, setLoading] = useState(false);
useEffect(() => {
setLoading(true)
…

Gabriele Sabatino
- 136
- 1
- 8
0
votes
1 answer
When use Syntactical form in react fragment then the editor text color will be changed. How to solve this problem
Here give the problem screenshot. How to solve this problem. have any away for solve this problem
[1]: https://i.stack.imgur.com/aHUvg.png reactFragment

Tarikul islam
- 21
- 7
0
votes
1 answer
Trying to add loop in function of React JS getting JSX expressions must have one parent element
I tried adding <> > as mentioned in other answers but that dint work.
Its a simple function component with return statement:
export default function Merchant4SubscriptionForm(props) {
//some code
return (
//some rendering

Sakshi
- 73
- 3
- 12
0
votes
2 answers
React.js JSX Fragment errors and HTML missing Tags
In Visual Studios code, it keeps telling me I am missing a
and

xXKyrusXx
- 5
- 5
0
votes
1 answer
React 16 Fragments Misuse
In React version 16, Fragments were implemented. I love using them!
My question is, what if I use Fragments unnecessarily. Does it matter? Can I stick them in as boilerplate for my code in-case I want to add adjacent elements later or is that bad…

Barry Michael Doyle
- 9,333
- 30
- 83
- 143
-3
votes
1 answer
Can a fragment have an attribute?
I have to set an attribute to the fragment. I want to do something like this:
abcd
>
Is there any way to do like this?

wantyouring
- 187
- 2
- 13