score:0
you need to wrap your elements with another element (or a fragment). try the following:
import react from "react";
import styles from "./styles";
import { getcaptionfromedges } from "./helpers";
const posts = (props) => {
const { data } = props;
return (
<>
<img src={data.owner.profile_pic_url} />
<p>{data.owner.node.username}</p>
<hr />
<p>{data.node.text}</p>
</>
);
};
export default posts;
Source: stackoverflow.com
Related Query
- How to render html tag on React while fetching data from json
- React app using json server, unable to render data from server
- Error: Objects are not valid as a React child. If you meant to render a collection of children, use an array instead. Getting data from JSON
- How do I render a list from Json data in express js, then render it using react and map()?
- Render JSON data from API call in react
- React render instagram feeds from data.json
- loading json data from local file into React JS
- How to get the data from React Context Consumer outside the render
- Render HTML from a json string in react
- React - load all data from json into component
- Rendering React components from json data dynamically
- Render React Native Elements from JSON
- Laravel 5.5 render a React component in a blade view with data from the controller
- Using fetch to render json data in react app
- React - this.state is null inside render when getting data from API
- How to render Pretty json data inside text area React js?
- Reading data from JSON file using react
- How to render data received from a REST service in React Universal? (Next.js)
- React native Material drop down get id from json data
- How to Read image data from API and render in React Component
- Render data from localStorage with react
- React How to render nested dropdown list in a form from a json data?
- How to fetch and display data from json file in react typscript
- I can not collect data from my json - React
- React iterate over object from json data
- How to display JSON data inside render as table in React
- Passing data from json via React Router
- How to filter JSON data from API and setState in React
- Pagination with React from JSON data issue
- How To Conditional Render Data From 2 Data Sources Using React
More Query from same tag
- Using JsZipUtils with NPM & React - file can't be imported
- Issue with image download using node
- React Navigation: How to update navigation title for parent, when value comes from redux and gets updated in child?
- Preserve white space line breaks in tinymce wysiwyg editor
- How to update state of dynamic radio input in reactjs?
- Call function from component in react Route
- setState in react is not working in react component
- ReactJs - Link dropdown should open separately while hovering
- why form not taking input in the input field in react
- How Sub classing with extends for React or Javascript work?
- REACT How do I add the value of a text area to a specific Component?
- Insert a React component inside markdown without MDX
- Passing an icon component to another component in ReactJS
- Application screen goes blank and shows error (Type Error: Assignment to constant)
- ReactJS: Prop referencing a state var. is not updated after parent's state change
- no response socket.io with reactjs
- Pass component as a prop in Reactjs
- How do I use Config Vars in Heroku to get my API key to work?
- How to Update This Reactjs Select
- create-react-app installs, but fails to run with "start"
- How to select only one button with React Typescript?
- setState not updating state on initial submit, only on subsequent submits
- Redux Store Adds Duplicate Content and Navigation to Original Selection Produces Empty Array
- react app, load components based on dropdown option
- calculated value of a var does not affect in pie chart in react
- Why does my react app go to the custom 404 not found page when the link is clicked?
- react.js custom events for communicating with parent nodes
- I am having an issue with react router as my url is getting updated on clicking on it but the page is not getting rendered
- React - Mutating form object for each change . Is that anyway we can do it in a better way
- How to enable persistence on reactfire?