beforeEach(() => { ogValue = memo(() => result()[0].attributes.content); cardValue = memo(() => result()[1].attributes.content); result = memo(() => builders.image(item(), entitiesRepo())); });
render() { const { isLoaded, post } = this.state; if (!isLoaded) { return <div>Loading...</div>; } return ( <div className="blog-post"> <h2 className="blog-post-title">{post.title}</h2> <p className="blog-post-meta">{new Date(post.date).toUTCString()} by <a href="/about/">{post.author}</a></p> <p><img width="480" src={post.image} alt="" /></p> <p>{post.summary}</p> <p>{post.fullText}</p> </div> ); }
render(){ console.log(this.props); const recipe = this.state.activeRecipe; return( <div className='container'> { this.state.activeRecipe.length !== 0 && <div className='active-recipe'> <img className='active-recipe__img' src={recipe_url + recipe.image} alt={recipe.title} /> <h3 className='active-recipe__title'>{recipe.title}</h3> <h4 className='active-recipe__publisher'> Credit: <span>{recipe.sourceName}</span> </h4> <p className='active-recipe__website'>Website: <a href={recipe.sourceUrl}><span>{recipe.sourceName}</span></a> </p> <button className='active-recipe__button'> <Link to='/'>Home</Link> </button> </div> } </div> ); }
<Row className="user_comment" id={comment._id}> <Col md={2}> <img class="photo" src={profile_img || comment.userId?.image } alt="I"></img> </Col> <Col md={10}>
locales = memo(() => ['en', 'it']); result = memo(() => builders.image(item(), entitiesRepo(), { locale: 'en' }), ); });