Skip to content

Commit

Permalink
Fix typechecking errors in css styles (read more)
Browse files Browse the repository at this point in the history
There is an issue with the `flexDirection` property
I am consistently getting an error about it and the only fix I found is
cssinjs/jss#1344 (comment)
which states to add `as React.CSSProperties` when I declare a style
  • Loading branch information
ajtran303 committed Jun 17, 2023
1 parent 1066b52 commit df330f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function App(): JSX.Element {
return (
<>
<Header />
<main style={containerStyle}>
<main style={containerStyle as React.CSSProperties}>
<Form onSubmit={handleSubmit} />
<Result weatherData={weatherData} />
</main>
Expand Down
4 changes: 2 additions & 2 deletions src/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ function Form(props: any): JSX.Element {
}

return (
<form className="weather-form" method="get" onSubmit={onSubmit} style={containerStyle}>
<label htmlFor="target-city" style={labelStyle}>City: </label>
<form className="weather-form" method="get" onSubmit={onSubmit} style={containerStyle as React.CSSProperties}>
<label htmlFor="target-city" style={labelStyle as React.CSSProperties}>City: </label>
<input type="text" id="target-city" name="city" placeholder="Enter your city" style={inputStyle} onFocus={handleFocus} onBlur={handleBlur} />
<button type="submit">Search</button>
</form>
Expand Down

0 comments on commit df330f7

Please sign in to comment.