feat(webpack-react): read *.json file

This commit is contained in:
dancingCycle 2024-01-04 15:39:29 +01:00
parent 810b53625a
commit f4de3318d1
1 changed files with 5 additions and 5 deletions

View File

@ -2,7 +2,7 @@ import React from 'react';
import Hello from '../components/hello';
import '../style.css';
// import JSON osmQueryJson
// import JSON
import jsonOsmQuery from '../osm-query.json';
const Home = () => {
@ -17,10 +17,10 @@ const Home = () => {
<div className='container'>
<p>Blog RryOsmQuery</p>
<div className='rryOsmQuery'>
{rryOsmQuery.map((post) => (
<div className='post' key={post.id}>
<p className='title'>{post.title}</p>
<p className='content'>{post.query}</p>
{rryOsmQuery.map((query) => (
<div className='query' key={query.id}>
<p className='title'>{query.title}</p>
<p className='content'>{query.query}</p>
</div>
))}
</div>