Q:

How can I seperate all the titles from json file whose title contain a given word?

Here's a piece of function just return props to element named box in React.
In this MovieDatabase is a JSON file which contains titles of different movies. I want to only that movies whose name includes "Star Wars".
const showMovies = MovieDatabase.map((movie) =>{
const aa = movie.title.contains("Star Wars")
return (
    <Box movieName = {aa} />
);})

A:

I think it'd be better to filter separate from the component.
Here's a way:
// assuming the DB is something like this based on your .map example
const MovieDatabase = [
    { title: 'Star Wars: II', id: 0 },
    { title: 'Star Wars: I', id: 1 },
    { title: 'Star Wars: IV', id: 2 },
    { title: 'Moon', id: 3 }
  ]

// array of star wars movies
const starWars = MovieDatabase.filter(movie => movie.title.includes('Star Wars'))

// component to render movies ( doesn't care about anything but rendering )
const MovieBoxes = movies => movies.map(movie => (
  <Box key={movie.id} movieName={movie.title} />
)

You could further improve it by wrapping the filter in a function that takes a keyword and passes it to includes so you can find any movie.

