Unexpected empty object pattern.
2import context from "../../../store/context";
3import Carousel from "../../Carousel/Carousel";
4
5const Trending = ({}) => { 6 const { trendingApiData, trendingIsLoading, trender } = useContext(context);
7 // console.log("...trender", trender);
8 trendingApiData &&
Unexpected empty object pattern.
3import Carousel from "../../Carousel/Carousel";
4import SlickCarousel from "../../../SlickCarousel";
5
6const Love = ({}) => { 7 const { loveApiData, loveIsLoading } = useContext(context);
8 // console.log("...trender", trender);
9
Unexpected empty object pattern.
2import context from "../../../store/context";
3import Carousel from "../../Carousel/Carousel";
4
5const Comedy = ({}) => { 6 const { comedyApiData, comedyIsLoading, trender } = useContext(context);
7 // console.log("...trender", trender);
8 comedyApiData && console.log("...Trending apiData in Tending", comedyApiData);
Unexpected empty object pattern.
2import context from "../../../store/context";
3import Carousel from "../../Carousel/Carousel";
4
5const Action = ({}) => { 6 const { actionApiData, actionIsLoading, actioneer } = useContext(context);
7 // console.log("...trender", trender);
8
Description
When using destructuring, it's possible to create a pattern that has no effect. This happens when empty curly braces are used to the right of an embedded object destructuring pattern, such as:
// doesn't create any variables
const {a : {}} = foo;
In many cases, the empty object pattern is a mistake where the author intended to use a default value instead, such as:
// creates a variable a
const {a = {}} = foo;
Bad Practice
cosnt {} = foo;
const [] = foo;
const {a: {}} = foo;
const {a: []} = foo;
function foo({}) {}
function foo([]) {}
function foo({a: {}}) {}
function foo({a: []}) {}
Recommended
const {a = {}} = foo;
const {a = []} = foo;
function foo({a = {}}) {}
function foo({a = []}) {}